mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-01 22:58:12 +00:00
parent
da8a238ffc
commit
83f232e55f
@ -29,6 +29,8 @@ from ..models import SEToolsListModel, invert_list_selection
|
|||||||
from ..mlsrulemodel import MLSRuleTableModel
|
from ..mlsrulemodel import MLSRuleTableModel
|
||||||
from ..widget import SEToolsWidget
|
from ..widget import SEToolsWidget
|
||||||
from .queryupdater import QueryResultsUpdater
|
from .queryupdater import QueryResultsUpdater
|
||||||
|
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
|
||||||
|
save_checkboxes, save_lineedits, save_listviews, save_textedits
|
||||||
|
|
||||||
|
|
||||||
class MLSRuleQueryTab(SEToolsWidget, QScrollArea):
|
class MLSRuleQueryTab(SEToolsWidget, QScrollArea):
|
||||||
@ -210,6 +212,37 @@ class MLSRuleQueryTab(SEToolsWidget, QScrollArea):
|
|||||||
self.default_range.setToolTip("Error: {0}".format(ex))
|
self.default_range.setToolTip("Error: {0}".format(ex))
|
||||||
self.default_range.setPalette(self.error_palette)
|
self.default_range.setPalette(self.error_palette)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Save/Load tab
|
||||||
|
#
|
||||||
|
def save(self):
|
||||||
|
"""Return a dictionary of settings."""
|
||||||
|
settings = {}
|
||||||
|
save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
|
||||||
|
"range_transition",
|
||||||
|
"source_indirect", "source_regex",
|
||||||
|
"target_indirect", "target_regex"])
|
||||||
|
|
||||||
|
save_lineedits(self, settings, ["source", "target", "default_range"])
|
||||||
|
|
||||||
|
save_listviews(self, settings, ["tclass"])
|
||||||
|
|
||||||
|
save_textedits(self, settings, ["notes"])
|
||||||
|
|
||||||
|
return settings
|
||||||
|
|
||||||
|
def load(self, settings):
|
||||||
|
load_checkboxes(self, settings, ["criteria_expander", "notes_expander",
|
||||||
|
"range_transition",
|
||||||
|
"source_indirect", "source_regex",
|
||||||
|
"target_indirect", "target_regex"])
|
||||||
|
|
||||||
|
load_lineedits(self, settings, ["source", "target", "default_range"])
|
||||||
|
|
||||||
|
load_listviews(self, settings, ["tclass"])
|
||||||
|
|
||||||
|
load_textedits(self, settings, ["notes"])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Results runner
|
# Results runner
|
||||||
#
|
#
|
||||||
|
@ -29,6 +29,8 @@ from ..models import SEToolsListModel, invert_list_selection
|
|||||||
from ..rbacrulemodel import RBACRuleTableModel
|
from ..rbacrulemodel import RBACRuleTableModel
|
||||||
from ..widget import SEToolsWidget
|
from ..widget import SEToolsWidget
|
||||||
from .queryupdater import QueryResultsUpdater
|
from .queryupdater import QueryResultsUpdater
|
||||||
|
from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \
|
||||||
|
save_checkboxes, save_lineedits, save_listviews, save_textedits
|
||||||
|
|
||||||
|
|
||||||
class RBACRuleQueryTab(SEToolsWidget, QScrollArea):
|
class RBACRuleQueryTab(SEToolsWidget, QScrollArea):
|
||||||
@ -231,6 +233,39 @@ class RBACRuleQueryTab(SEToolsWidget, QScrollArea):
|
|||||||
self.clear_default_error()
|
self.clear_default_error()
|
||||||
self.set_default_role()
|
self.set_default_role()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Save/Load tab
|
||||||
|
#
|
||||||
|
def save(self):
|
||||||
|
"""Return a dictionary of settings."""
|
||||||
|
settings = {}
|
||||||
|
save_checkboxes(self, settings, ["criteria_expander", "notes_expander",
|
||||||
|
"allow", "role_transition",
|
||||||
|
"source_indirect", "source_regex",
|
||||||
|
"target_indirect", "target_regex",
|
||||||
|
"default_regex"])
|
||||||
|
|
||||||
|
save_lineedits(self, settings, ["source", "target", "default_role"])
|
||||||
|
|
||||||
|
save_listviews(self, settings, ["tclass"])
|
||||||
|
|
||||||
|
save_textedits(self, settings, ["notes"])
|
||||||
|
|
||||||
|
return settings
|
||||||
|
|
||||||
|
def load(self, settings):
|
||||||
|
load_checkboxes(self, settings, ["criteria_expander", "notes_expander",
|
||||||
|
"allow", "role_transition",
|
||||||
|
"source_indirect", "source_regex",
|
||||||
|
"target_indirect", "target_regex",
|
||||||
|
"default_regex"])
|
||||||
|
|
||||||
|
load_lineedits(self, settings, ["source", "target", "default_role"])
|
||||||
|
|
||||||
|
load_listviews(self, settings, ["tclass"])
|
||||||
|
|
||||||
|
load_textedits(self, settings, ["notes"])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Results runner
|
# Results runner
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user