* 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
This commit is contained in:
Don Allingham 2006-11-12 03:35:52 +00:00
parent 6d5598173c
commit 5314c575b1
5 changed files with 57 additions and 8 deletions

View File

@ -1,9 +1,14 @@
2006-11-11 Don Allingham <don@gramps-project.org>
* 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 <Martin.Hawlisch@gmx.de>
* test/GrampsDb/GrampsDbTestBase.py: Provide a callback to db.load().

View File

@ -123,6 +123,18 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/preferences/use-last-view</key>
<applyto>/apps/gramps/preferences/use-last-view</applyto>
<owner>gramps</owner>
<type>bool</type>
<default>1</default>
<locale name="C">
<short>Use last view displayed</short>
<long>Indicates the GRAMPS should remember last view displayed.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/preferences/family-siblings</key>
<applyto>/apps/gramps/preferences/family-siblings</applyto>
@ -237,6 +249,30 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/family-height</key>
<applyto>/apps/gramps/interface/family-height</applyto>
<owner>gramps</owner>
<type>int</type>
<default>500</default>
<locale name="C">
<short>Height of the family editor interface.</short>
<long>Specifies the height of the family editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/family-width</key>
<applyto>/apps/gramps/interface/family-width</applyto>
<owner>gramps</owner>
<type>int</type>
<default>700</default>
<locale name="C">
<short>Width of the family editor interface.</short>
<long>Specifies the width of the family editor interface.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gramps/interface/filter</key>
<applyto>/apps/gramps/interface/filter</applyto>

View File

@ -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',

View File

@ -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

View File

@ -665,9 +665,13 @@ class ViewManager:
self.buttons.append(button)
self.button_handlers.append(handler_id)
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]
self.buttons[current].set_active(True)