apol: Tabs raise exceptions if trying to save while there are errors.

Closes #97
Closes #98
This commit is contained in:
Chris PeBenito 2016-07-09 13:22:09 -04:00
parent 5fd724b300
commit ddca4536ee
22 changed files with 110 additions and 0 deletions

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..boolmodel import BooleanTableModel, boolean_detail from ..boolmodel import BooleanTableModel, boolean_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -139,6 +140,10 @@ class BoolQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"default_any", "default_true", "default_false", "default_any", "default_true", "default_false",

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..boundsmodel import BoundsTableModel from ..boundsmodel import BoundsTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -144,6 +145,10 @@ class BoundsQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"typebounds", "typebounds",

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..mlsmodel import MLSComponentTableModel, category_detail from ..mlsmodel import MLSComponentTableModel, category_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -139,6 +140,10 @@ class CategoryQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex"]) save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex"])
save_lineedits(self, settings, ["name"]) save_lineedits(self, settings, ["name"])

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..commonmodel import CommonTableModel, common_detail from ..commonmodel import CommonTableModel, common_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -163,6 +164,10 @@ class CommonQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"perms_equal"]) "perms_equal"])

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import PermListModel, SEToolsListModel, invert_list_selection from ..models import PermListModel, SEToolsListModel, invert_list_selection
from ..constraintmodel import ConstraintTableModel from ..constraintmodel import ConstraintTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -264,6 +265,10 @@ class ConstraintQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "constrain", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "constrain",
"mlsconstrain", "validatetrans", "mlsvalidatetrans", "mlsconstrain", "validatetrans", "mlsvalidatetrans",

View File

@ -28,6 +28,7 @@ from setools import DomainTransitionAnalysis
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .excludetypes import ExcludeTypes from .excludetypes import ExcludeTypes
from .exception import TabFieldError
from .workspace import load_checkboxes, load_spinboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_spinboxes, load_lineedits, load_textedits, \
save_checkboxes, save_spinboxes, save_lineedits, save_textedits save_checkboxes, save_spinboxes, save_lineedits, save_textedits
@ -202,6 +203,10 @@ class DomainTransitionAnalysisTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "all_paths", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "all_paths",
"all_shortest_paths", "flows_in", "flows_out", "reverse"]) "all_shortest_paths", "flows_in", "flows_out", "reverse"])

View File

@ -27,6 +27,7 @@ from setools import FSUseQuery
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from ..fsusemodel import FSUseTableModel from ..fsusemodel import FSUseTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -257,6 +258,10 @@ class FSUseQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"fs_regex", "fs_use_xattr", "fs_use_trans", "fs_use_task", "fs_regex", "fs_use_xattr", "fs_use_trans", "fs_use_task",

View File

@ -27,6 +27,7 @@ from setools import GenfsconQuery
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from ..genfsconmodel import GenfsconTableModel from ..genfsconmodel import GenfsconTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -264,6 +265,10 @@ class GenfsconQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"fs_regex", "path_regex", "fs_regex", "path_regex",

View File

@ -30,6 +30,7 @@ from setools.exception import UnmappedClass, UnmappedPermission
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .excludetypes import ExcludeTypes from .excludetypes import ExcludeTypes
from .permmapedit import PermissionMapEditor from .permmapedit import PermissionMapEditor
from .workspace import load_checkboxes, load_spinboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_spinboxes, load_lineedits, load_textedits, \
@ -229,6 +230,10 @@ class InfoFlowAnalysisTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "all_paths", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "all_paths",
"all_shortest_paths", "flows_in", "flows_out"]) "all_shortest_paths", "flows_in", "flows_out"])

View File

@ -27,6 +27,7 @@ from setools import InitialSIDQuery
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from ..initsidmodel import InitialSIDTableModel from ..initsidmodel import InitialSIDTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -241,6 +242,10 @@ class InitialSIDQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"user_regex", "role_regex", "type_regex", "range_exact", "user_regex", "role_regex", "type_regex", "range_exact",

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..mlsrulemodel import MLSRuleTableModel from ..mlsrulemodel import MLSRuleTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -212,6 +213,10 @@ class MLSRuleQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"range_transition", "range_transition",

View File

@ -27,6 +27,7 @@ from setools import NetifconQuery
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from ..netifconmodel import NetifconTableModel from ..netifconmodel import NetifconTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -241,6 +242,10 @@ class NetifconQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"user_regex", "role_regex", "type_regex", "range_exact", "user_regex", "role_regex", "type_regex", "range_exact",

View File

@ -28,6 +28,7 @@ from setools import NodeconQuery
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from ..nodeconmodel import NodeconTableModel from ..nodeconmodel import NodeconTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, load_comboboxes, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, load_comboboxes, \
save_checkboxes, save_lineedits, save_textedits, save_comboboxes save_checkboxes, save_lineedits, save_textedits, save_comboboxes
@ -244,6 +245,10 @@ class NodeconQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"network_exact", "network_overlap", "network_exact", "network_overlap",

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import PermListModel, SEToolsListModel, invert_list_selection from ..models import PermListModel, SEToolsListModel, invert_list_selection
from ..objclassmodel import ObjClassTableModel, class_detail from ..objclassmodel import ObjClassTableModel, class_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -174,6 +175,10 @@ class ObjClassQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"perms_equal"]) "perms_equal"])

View File

@ -27,6 +27,7 @@ from setools import PortconQuery
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
from ..portconmodel import PortconTableModel from ..portconmodel import PortconTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, load_comboboxes, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, load_comboboxes, \
save_checkboxes, save_lineedits, save_textedits, save_comboboxes save_checkboxes, save_lineedits, save_textedits, save_comboboxes
@ -248,6 +249,10 @@ class PortconQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "ports_exact", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "ports_exact",
"ports_overlap", "ports_subset", "ports_superset", "ports_overlap", "ports_subset", "ports_superset",

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..rbacrulemodel import RBACRuleTableModel from ..rbacrulemodel import RBACRuleTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -233,6 +234,10 @@ class RBACRuleQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"allow", "role_transition", "allow", "role_transition",

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..rolemodel import RoleTableModel, role_detail from ..rolemodel import RoleTableModel, role_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -160,6 +161,10 @@ class RoleQueryTab(AnalysisTab):
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
settings = {} settings = {}
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"types_any", "types_equal"]) "types_any", "types_equal"])
save_lineedits(self, settings, ["name"]) save_lineedits(self, settings, ["name"])

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..mlsmodel import MLSComponentTableModel, sensitivity_detail from ..mlsmodel import MLSComponentTableModel, sensitivity_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_textedits, \
save_checkboxes, save_lineedits, save_textedits save_checkboxes, save_lineedits, save_textedits
@ -139,6 +140,10 @@ class SensitivityQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex"]) save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex"])
save_lineedits(self, settings, ["name"]) save_lineedits(self, settings, ["name"])

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import PermListModel, SEToolsListModel, invert_list_selection from ..models import PermListModel, SEToolsListModel, invert_list_selection
from ..terulemodel import TERuleTableModel from ..terulemodel import TERuleTableModel
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -327,6 +328,10 @@ class TERuleQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
"allow", "allowxperm", "allow", "allowxperm",

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..typeattrmodel import TypeAttributeTableModel, typeattr_detail from ..typeattrmodel import TypeAttributeTableModel, typeattr_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -159,6 +160,10 @@ class TypeAttributeQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"types_any", "types_equal"]) "types_any", "types_equal"])

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..typemodel import TypeTableModel, type_detail from ..typemodel import TypeTableModel, type_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -159,6 +160,10 @@ class TypeQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"attrs_any", "attrs_equal", "permissive"]) "attrs_any", "attrs_equal", "permissive"])

View File

@ -28,6 +28,7 @@ from ..logtosignal import LogHandlerToSignal
from ..models import SEToolsListModel, invert_list_selection from ..models import SEToolsListModel, invert_list_selection
from ..usermodel import UserTableModel, user_detail from ..usermodel import UserTableModel, user_detail
from .analysistab import AnalysisTab from .analysistab import AnalysisTab
from .exception import TabFieldError
from .queryupdater import QueryResultsUpdater from .queryupdater import QueryResultsUpdater
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
save_checkboxes, save_lineedits, save_listviews, save_textedits save_checkboxes, save_lineedits, save_listviews, save_textedits
@ -208,6 +209,10 @@ class UserQueryTab(AnalysisTab):
# #
def save(self): def save(self):
"""Return a dictionary of settings.""" """Return a dictionary of settings."""
if self.errors:
raise TabFieldError("Field(s) are in error: {0}".
format(" ".join(o.objectName() for o in self.errors)))
settings = {} settings = {}
save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", save_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex",
"roles_any", "roles_equal", "level_exact", "level_dom", "roles_any", "roles_equal", "level_exact", "level_dom",