diff --git a/ChangeLog b/ChangeLog index 204569667..beb2df458 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-11-16 Martin Hawlisch + * src/Config/_GrampsConfigKeys.py: Add keys for the PedigreeView + * src/DataViews/_PedigreeView.py: Remember tree settings in config + 2007-11-13 Brian Matherly * src/plugins/NarrativeWeb.py: Fix 0001369: Cannot translate (LivingProxy) references on NarrativeWeb dialog diff --git a/src/Config/_GrampsConfigKeys.py b/src/Config/_GrampsConfigKeys.py index 91f91291a..75a0e871f 100644 --- a/src/Config/_GrampsConfigKeys.py +++ b/src/Config/_GrampsConfigKeys.py @@ -97,6 +97,10 @@ SOURCE_WIDTH = ('interface', 'source-width', 1) SOURCE_REF_HEIGHT = ('interface', 'source-ref-height', 1) SOURCE_REF_WIDTH = ('interface', 'source-ref-width', 1) FILTER = ('interface', 'filter', 0) +PEDVIEW_TREESIZE = ('interface', 'pedview-tree-size', 1) +PEDVIEW_LAYOUT = ('interface', 'pedview-layout', 1) +PEDVIEW_SHOW_MARRIAGE= ('interface', 'pedview-show-marriage', 0) +PEDVIEW_SHOW_IMAGES = ('interface', 'pedview-show-images', 0) DATABASE_PATH = ('behavior', 'database-path', 2) FPREFIX = ('preferences', 'fprefix', 2) EPREFIX = ('preferences', 'eprefix', 2) @@ -206,6 +210,10 @@ default_value = { SOURCE_REF_HEIGHT : 450, SOURCE_REF_WIDTH : 600, FILTER : False, + PEDVIEW_TREESIZE : 0, + PEDVIEW_LAYOUT : 0, + PEDVIEW_SHOW_MARRIAGE: False, + PEDVIEW_SHOW_IMAGES : True, DATABASE_PATH : '~/.gramps/grampsdb', FPREFIX : 'F%04d', EPREFIX : 'E%04d', diff --git a/src/DataViews/_PedigreeView.py b/src/DataViews/_PedigreeView.py index 2fb36e02d..8120f0f74 100644 --- a/src/DataViews/_PedigreeView.py +++ b/src/DataViews/_PedigreeView.py @@ -60,7 +60,7 @@ from ReportBase import ReportUtils from Editors import EditPerson, EditFamily from DdTargets import DdTargets import cPickle as pickle - +import Config from QuestionDialog import RunDatabaseRepair, ErrorDialog #------------------------------------------------------------------------- @@ -463,10 +463,10 @@ class PedigreeView(PageView.PersonNavView): self.dbstate = dbstate self.dbstate.connect('database-changed',self.change_db) #self.dbstate.connect('active-changed',self.goto_active_person) - self.force_size = 0 # Automatic resize - self.tree_style = 0 # Nice tree - self.show_images = True # Show photos of persons - self.show_marriage_data = 0 # Hide marriage data by default + self.force_size = Config.get(Config.PEDVIEW_TREESIZE) # Automatic resize + self.tree_style = Config.get(Config.PEDVIEW_LAYOUT) # Nice tree + self.show_images = Config.get(Config.PEDVIEW_SHOW_IMAGES) # Show photos of persons + self.show_marriage_data = Config.get(Config.PEDVIEW_SHOW_MARRIAGE) # Hide marriage data by default self.format_helper = FormattingHelper( self.dbstate) def change_page(self): @@ -1215,12 +1215,14 @@ class PedigreeView(PageView.PersonNavView): def change_force_size_cb(self,event,data): if data in [0,2,3,4,5]: + Config.set(Config.PEDVIEW_TREESIZE,data) self.force_size = data self.dirty = True self.size_request_cb(self.notebook.parent,None) # switch to matching size def change_tree_style_cb(self,event,data): if data in [0,1]: + Config.set(Config.PEDVIEW_LAYOUT,data) if self.tree_style != data: self.dirty = True self.tree_style = data @@ -1231,6 +1233,7 @@ class PedigreeView(PageView.PersonNavView): def change_show_images_cb(self,event): self.show_images = not self.show_images + Config.set(Config.PEDVIEW_SHOW_IMAGES,self.show_images) self.dirty = True if self.dbstate.active: self.rebuild_trees(self.dbstate.active.handle) # Rebuild using new style @@ -1239,6 +1242,7 @@ class PedigreeView(PageView.PersonNavView): def change_show_marriage_cb(self,event): self.show_marriage_data = not self.show_marriage_data + Config.set(Config.PEDVIEW_SHOW_MARRIAGE,self.show_marriage_data) self.dirty = True if self.dbstate.active: self.rebuild_trees(self.dbstate.active.handle) # Rebuild using new style