From 00807f846d472de9fb8cafa2785ac00d09bc31d9 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Fri, 11 Mar 2016 09:16:59 -0500 Subject: [PATCH] TERuleListModel: Add conditional block column. --- setoolsgui/apol/rulemodels.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setoolsgui/apol/rulemodels.py b/setoolsgui/apol/rulemodels.py index c58cfc5..66d9364 100644 --- a/setoolsgui/apol/rulemodels.py +++ b/setoolsgui/apol/rulemodels.py @@ -159,11 +159,13 @@ class TERuleListModel(RuleListModel): return "Permissons/Default Type" elif section == 5: return "Conditional Expression" + elif section == 6: + return "Conditional Block" else: raise ValueError("Invalid column number: {0}".format(section)) def columnCount(self, parent=QModelIndex()): - return 6 + return 7 def data(self, index, role): if role == Qt.DisplayRole: @@ -191,6 +193,11 @@ class TERuleListModel(RuleListModel): return str(self.resultlist[row].conditional) except RuleNotConditional: return None + elif col == 6: + try: + return str(self.resultlist[row].conditional_block) + except RuleNotConditional: + return None else: raise ValueError("Invalid column number: {0}".format(col)) elif role == Qt.UserRole: