From 12ff47c896d1a7360c273132bd113fdf24f3d19d Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 12 Aug 2003 03:01:17 +0000 Subject: [PATCH] * src/gramps_main.py: apply the filter after a load of the database, allow default view to be set * src/GrampsCfg.py: handle the defaultview key to allow the user to choose Family or People view as the default * src/preferences.glade: defaultview settings svn: r1993 --- gramps2/src/GrampsCfg.py | 15 +++++++ gramps2/src/gramps_main.py | 6 +++ gramps2/src/preferences.glade | 83 ++++++++++++++++++++++++++++++++--- 3 files changed, 97 insertions(+), 7 deletions(-) diff --git a/gramps2/src/GrampsCfg.py b/gramps2/src/GrampsCfg.py index c41580be1..97a07f775 100644 --- a/gramps2/src/GrampsCfg.py +++ b/gramps2/src/GrampsCfg.py @@ -145,6 +145,7 @@ mediaref = 1 globalprop = 1 localprop = 1 capitalize = 0 +defaultview = 0 #------------------------------------------------------------------------- # @@ -212,6 +213,7 @@ def loadConfig(call): global globalprop global localprop global capitalize + global defaultview _callback = call lastfile = get_string("/apps/gramps/last-file") @@ -229,6 +231,7 @@ def loadConfig(call): index_visible = get_bool("/apps/gramps/index-visible") status_bar = get_int("/apps/gramps/statusbar") toolbar = get_int("/apps/gramps/toolbar",2) + defaultview = get_int("/apps/gramps/defaultview") autoload = get_bool("/apps/gramps/autoload",0) autosave_int = get_int("/apps/gramps/auto-save-interval") @@ -599,6 +602,11 @@ class GrampsPreferences: else: self.top.get_widget("tool3").set_active(1) + if defaultview == 0: + self.top.get_widget('pvbutton').set_active(1) + else: + self.top.get_widget('fvbutton').set_active(1) + paper_obj = self.top.get_widget("paper_size") menu = gtk.Menu() choice = 0 @@ -803,6 +811,7 @@ class GrampsPreferences: global index_visible global status_bar global toolbar + global defaultview global paper_preference global output_preference global goutput_preference @@ -846,6 +855,11 @@ class GrampsPreferences: else: toolbar = 2 + if self.top.get_widget("pvbutton").get_active(): + defaultview = 0 + else: + defaultview = 1 + iprefix = self.top.get_widget("iprefix").get_text() if iprefix == "": iprefix = "I" @@ -892,6 +906,7 @@ class GrampsPreferences: set_bool("/apps/gramps/index-visible",index_visible) set_int("/apps/gramps/statusbar",status_bar) set_int("/apps/gramps/toolbar",toolbar+1) + set_int("/apps/gramps/defaultview",defaultview) set_string("/apps/gramps/paper-preference",paper_preference) set_string("/apps/gramps/output-preference",output_preference) set_string("/apps/gramps/goutput-preference",goutput_preference) diff --git a/gramps2/src/gramps_main.py b/gramps2/src/gramps_main.py index 5a25d8a50..7ff8d417b 100755 --- a/gramps2/src/gramps_main.py +++ b/gramps2/src/gramps_main.py @@ -438,6 +438,11 @@ class Gramps: self.find_person = None self.find_source = None self.find_media = None + if GrampsCfg.defaultview == 0: + self.views.set_current_page(0) + else: + self.views.set_current_page(1) + self.topWindow.show() def change_alpha_page(self,obj,junk,page): @@ -959,6 +964,7 @@ class Gramps: else: GrampsCfg.save_last_file("") self.topWindow.set_resizable(gtk.TRUE) + self.apply_filter() self.goto_active_person(1) def cl_import(self,filename,format): diff --git a/gramps2/src/preferences.glade b/gramps2/src/preferences.glade index 1a7e9974d..e5dfa42da 100644 --- a/gramps2/src/preferences.glade +++ b/gramps2/src/preferences.glade @@ -967,8 +967,8 @@ 12 True - 3 - 3 + 6 + 2 False 6 12 @@ -989,8 +989,8 @@ 1 2 - 1 - 2 + 4 + 5 fill @@ -1012,8 +1012,8 @@ 1 2 - 2 - 3 + 5 + 6 fill @@ -1035,13 +1035,82 @@ 0 - 3 + 2 + 3 + 4 + fill + + + + + + + True + <b>Default view</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 2 0 1 fill + + + + True + True + Person view + True + GTK_RELIEF_NORMAL + False + False + True + + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + True + Family view + True + GTK_RELIEF_NORMAL + False + False + True + pvbutton + + + + 1 + 2 + 2 + 3 + fill + + + 0