From 5314c575b11fa2881b685261ff918ce885323df7 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 12 Nov 2006 03:35:52 +0000 Subject: [PATCH] * src/Config/_GrampsConfigKeys.py: add saving of family editor size, disabling of defaulting to last viwe * src/ViewManager.py: allow disabling of defaulting to last view * src/GrampsCfg.py: allow disabling of defaulting to last view * src/ViewManager.py: allow disabling of defaulting to last view * data/gramps.schemas.in: allow disabling of defaulting to last view svn: r7617 --- ChangeLog | 9 +++++++-- data/gramps.schemas.in | 36 +++++++++++++++++++++++++++++++++ src/Config/_GrampsConfigKeys.py | 10 +++++---- src/GrampsCfg.py | 2 ++ src/ViewManager.py | 8 ++++++-- 5 files changed, 57 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index bfa3bc3bd..a416ba116 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,15 @@ 2006-11-11 Don Allingham - * src/Config/_GrampsConfigKeys.py: add saving of family editor size + * src/Config/_GrampsConfigKeys.py: add saving of family editor size, disabling of + defaulting to last viwe * src/Editors/_EditFamily.py: add saving of family editor size * src/DisplayTabs/_GalleryTab.py: Catch possible exception * src/glade/gramps.glade: add saving of family editor size * src/DbLoader.py: Display error message on RUNRECOVERY error - + * src/ViewManager.py: allow disabling of defaulting to last view + * src/GrampsCfg.py: allow disabling of defaulting to last view + * src/ViewManager.py: allow disabling of defaulting to last view + * data/gramps.schemas.in: allow disabling of defaulting to last view + 2006-11-11 Martin Hawlisch * test/GrampsDb/GrampsDbTestBase.py: Provide a callback to db.load(). Hmmm, that worked without sometime back. diff --git a/data/gramps.schemas.in b/data/gramps.schemas.in index 8c296b092..bf6bb03f5 100644 --- a/data/gramps.schemas.in +++ b/data/gramps.schemas.in @@ -123,6 +123,18 @@ + + /schemas/apps/gramps/preferences/use-last-view + /apps/gramps/preferences/use-last-view + gramps + bool + 1 + + Use last view displayed + Indicates the GRAMPS should remember last view displayed. + + + /schemas/apps/gramps/preferences/family-siblings /apps/gramps/preferences/family-siblings @@ -237,6 +249,30 @@ + + /schemas/apps/gramps/interface/family-height + /apps/gramps/interface/family-height + gramps + int + 500 + + Height of the family editor interface. + Specifies the height of the family editor interface. + + + + + /schemas/apps/gramps/interface/family-width + /apps/gramps/interface/family-width + gramps + int + 700 + + Width of the family editor interface. + Specifies the width of the family editor interface. + + + /schemas/apps/gramps/interface/filter /apps/gramps/interface/filter diff --git a/src/Config/_GrampsConfigKeys.py b/src/Config/_GrampsConfigKeys.py index 99986f901..812f1f573 100644 --- a/src/Config/_GrampsConfigKeys.py +++ b/src/Config/_GrampsConfigKeys.py @@ -30,6 +30,7 @@ CUSTOM_MARKER_COLOR = ('preferences','custom-marker-color', 2) FAMILY_WARN = ('preferences','family-warn', 0) HIDE_EP_MSG = ('preferences','hide-ep-msg', 0) LAST_VIEW = ('preferences','last-view', 1) +USE_LAST_VIEW = ('preferences','use-last-view', 1) FAMILY_SIBLINGS = ('preferences','family-siblings', 0) AUTOLOAD = ('behavior','autoload', 0) SPELLCHECK = ('behavior','spellcheck', 0) @@ -39,8 +40,8 @@ DATE_FORMAT = ('preferences','date-format', 1) DONT_ASK = ('interface','dont-ask', 0) HEIGHT = ('interface','height', 1) WIDTH = ('interface','width', 1) -FAM_HEIGHT = ('interface','height', 1) -FAM_WIDTH = ('interface','width', 1) +FAMILY_HEIGHT = ('interface','family_height', 1) +FAMILY_WIDTH = ('interface','family_width', 1) FILTER = ('interface','filter', 0) FPREFIX = ('preferences','fprefix', 2) EPREFIX = ('preferences','eprefix', 2) @@ -92,6 +93,7 @@ default_value = { FAMILY_WARN : True, HIDE_EP_MSG : False, LAST_VIEW : 0, + USE_LAST_VIEW : True, FAMILY_SIBLINGS : True, AUTOLOAD : False, SPELLCHECK : False, @@ -101,8 +103,8 @@ default_value = { DONT_ASK : False, HEIGHT : 500, WIDTH : 775, - FAM_HEIGHT : 500, - FAM_WIDTH : 700, + FAMILY_HEIGHT : 500, + FAMILY_WIDTH : 700, FILTER : False, FPREFIX : 'F%04d', EPREFIX : 'E%04d', diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 4a0b089c6..964567e54 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -506,6 +506,8 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): 5, Config.RELATION_SHADE) self.add_checkbox(table, _('Display edit buttons on Relationship View'), 6, Config.RELEDITBTN) + self.add_checkbox(table, _('Remember last view displayed'), + 7, Config.USE_LAST_VIEW) return table diff --git a/src/ViewManager.py b/src/ViewManager.py index 0002ab7b9..85d72931c 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -665,8 +665,12 @@ class ViewManager: self.buttons.append(button) self.button_handlers.append(handler_id) - current = Config.get(Config.LAST_VIEW) - if current > len(self.pages): + use_current = Config.get(Config.USE_LAST_VIEW) + if use_current: + current = Config.get(Config.LAST_VIEW) + if current > len(self.pages): + current = 0 + else: current = 0 self.active_page = self.pages[current]