diff --git a/setoolsgui/apol/userquery.py b/setoolsgui/apol/userquery.py index dfd367f..160d49b 100644 --- a/setoolsgui/apol/userquery.py +++ b/setoolsgui/apol/userquery.py @@ -29,6 +29,8 @@ from ..models import SEToolsListModel, invert_list_selection from ..usermodel import UserTableModel, user_detail from ..widget import SEToolsWidget from .queryupdater import QueryResultsUpdater +from .workspace import load_checkboxes, load_lineedits, load_listviews, load_textedits, \ + save_checkboxes, save_lineedits, save_listviews, save_textedits class UserQueryTab(SEToolsWidget, QScrollArea): @@ -206,6 +208,30 @@ class UserQueryTab(SEToolsWidget, QScrollArea): self.range_.setToolTip("Error: " + str(ex)) self.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", "name_regex", + "roles_any", "roles_equal", "level_exact", "level_dom", + "level_domby", "range_exact", "range_overlap", + "range_subset", "range_superset"]) + save_lineedits(self, settings, ["name", "level", "range_"]) + save_listviews(self, settings, ["roles"]) + save_textedits(self, settings, ["notes"]) + return settings + + def load(self, settings): + load_checkboxes(self, settings, ["criteria_expander", "notes_expander", "name_regex", + "roles_any", "roles_equal", "level_exact", "level_dom", + "level_domby", "range_exact", "range_overlap", + "range_subset", "range_superset"]) + load_lineedits(self, settings, ["name", "level", "range_"]) + load_listviews(self, settings, ["roles"]) + load_textedits(self, settings, ["notes"]) + # # Results runner #