From bbb8b5161d9a0708a263f5a9fde0f909e7ff58df Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Tue, 6 Dec 2016 11:59:04 -0800 Subject: [PATCH] 9795: remember the last location of windows [partial: filter dialogs] --- gramps/gen/config.py | 9 +++------ gramps/gui/editors/filtereditor.py | 10 ++++------ gramps/gui/glade/rule.glade | 5 ----- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/gramps/gen/config.py b/gramps/gen/config.py index c21c9e23d..c236ad8b4 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -181,6 +181,9 @@ register('geography.show_cross', False) register('geography.path', "") register('geography.use-keypad', True) +# note that other calls to "register" are done in realtime (when +# needed), for instance to four 'interface.clipboard' variables -- +# so do a recursive grep for "setup_configs" to see all the (base) names register('interface.addmedia-height', 500) register('interface.addmedia-width', 700) register('interface.address-height', 450) @@ -198,10 +201,6 @@ register('interface.view-categories', ["Dashboard", "People", "Relationships", "Families", "Ancestry", "Events", "Places", "Geography", "Sources", "Citations", "Repositories", "Media", "Notes"]) -register('interface.edit-filter-width', 500) -register('interface.edit-filter-height', 420) -register('interface.edit-rule-width', 600) -register('interface.edit-rule-height', 450) register('interface.event-height', 450) register('interface.event-ref-height', 450) register('interface.event-ref-width', 600) @@ -213,8 +212,6 @@ register('interface.family-sel-height', 450) register('interface.family-sel-width', 600) register('interface.family-width', 700) register('interface.filter', False) -register('interface.filter-editor-width', 400) -register('interface.filter-editor-height', 350) register('interface.fullscreen', False) register('interface.grampletbar-close', False) register('interface.ignore-gexiv2', False) diff --git a/gramps/gui/editors/filtereditor.py b/gramps/gui/editors/filtereditor.py index 6524a5ca2..f2cd8607e 100644 --- a/gramps/gui/editors/filtereditor.py +++ b/gramps/gui/editors/filtereditor.py @@ -439,8 +439,6 @@ class EditRule(ManagedWindow): def __init__(self, namespace, dbstate, uistate, track, filterdb, val, label, update, filter_name): ManagedWindow.__init__(self, uistate, track, EditRule) - self.width_key = "interface.edit-rule-width" - self.height_key = "interface.edit-rule-height" self.namespace = namespace self.dbstate = dbstate self.db = dbstate.db @@ -453,6 +451,7 @@ class EditRule(ManagedWindow): self.set_window(self.get_widget('rule_editor'), self.get_widget('rule_editor_title'),label) + self.setup_configs('interface.edit-rule', 600, 450) self.window.hide() self.valuebox = self.get_widget('valuebox') self.rname_filter = self.get_widget('ruletreefilter') @@ -798,8 +797,6 @@ class EditFilter(ManagedWindow): filterdb, update=None, selection_callback=None): ManagedWindow.__init__(self, uistate, track, self) - self.width_key = "interface.edit-filter-width" - self.height_key = "interface.edit-filter-height" self.namespace = namespace self.update = update self.dbstate = dbstate @@ -814,6 +811,7 @@ class EditFilter(ManagedWindow): self.get_widget('define_filter'), self.get_widget('definition_title'), _('Define filter')) + self.setup_configs('interface.edit-filter', 500, 420) self.rlist = ListModel( self.get_widget('rule_list'), @@ -964,6 +962,7 @@ class ShowResults(ManagedWindow): self.get_widget('test'), self.get_widget('test_title'), _('Filter Test')) + self.setup_configs('interface.showresults', 450, 400) render = Gtk.CellRendererText() @@ -1069,8 +1068,6 @@ class FilterEditor(ManagedWindow): self.db = dbstate.db self.filterdb = FilterList(filterdb) self.filterdb.load() - self.width_key = "interface.filter-editor-width" - self.height_key = "interface.filter-editor-height" self.namespace = namespace self.define_glade('filter_list', RULE_GLADE) @@ -1088,6 +1085,7 @@ class FilterEditor(ManagedWindow): self.set_window(self.get_widget('filter_list'), self.get_widget('filter_list_title'), _TITLES[self.namespace]) + self.setup_configs('interface.filter-editor', 400, 350) self.edit.connect('clicked', self.edit_filter) self.clone.connect('clicked', self.clone_filter) diff --git a/gramps/gui/glade/rule.glade b/gramps/gui/glade/rule.glade index 258fa8817..f57a05ee6 100644 --- a/gramps/gui/glade/rule.glade +++ b/gramps/gui/glade/rule.glade @@ -5,8 +5,6 @@ False - 400 - 350 dialog center @@ -299,7 +297,6 @@ False - 500 dialog center @@ -1008,8 +1005,6 @@ False - 450 - 400 dialog center