diff --git a/ChangeLog b/ChangeLog index 5fbcfc983..40e113e00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,10 @@ * src/gramps_main.py (pref_callback): Update statusbar from prefs (needed for Family View). * NEWS: Instant prefs. + * src/FamilyView.py (set_widgets): Do not connect buttons if this + view is already initialized. + * src/GrampsCfg.py: Set GNOME toolbar prefs as the default. + Correct existing gconf key detection. 2003-10-15 Alex Roitman * src/gramps.glade: Correct tooltips. diff --git a/src/FamilyView.py b/src/FamilyView.py index 0dd415054..12674468c 100644 --- a/src/FamilyView.py +++ b/src/FamilyView.py @@ -70,6 +70,7 @@ class FamilyView: self.init_interface() def set_widgets(self,val): + already_init = self.cadded[val] if (val): self.ap_data = self.top.get_widget('ap_data2') self.swap_btn = self.top.get_widget('swap_btn2') @@ -80,16 +81,17 @@ class FamilyView: self.select_spouse_btn = self.top.get_widget('select_spouse2') self.remove_spouse_btn = self.top.get_widget('remove_spouse2') self.child_list = self.top.get_widget('chlist2') - self.top.get_widget('add_parents2').connect('clicked',self.add_parents_clicked) - self.top.get_widget('del_parents2').connect('clicked',self.del_parents_clicked) - self.top.get_widget('add_spparents2').connect('clicked',self.add_sp_parents) - self.top.get_widget('del_spparents2').connect('clicked',self.del_sp_parents) - self.top.get_widget('fam_back2').connect('clicked',self.child_back) - self.top.get_widget('del_child_btn2').connect('clicked',self.remove_child_clicked) - self.top.get_widget('add_child_btn2').connect('clicked',self.add_child_clicked) - self.top.get_widget('select_child2').connect('clicked',self.select_child_clicked) - self.top.get_widget('ap_parents_btn2').connect('clicked',self.ap_parents_clicked) - self.top.get_widget('sp_parents_btn2').connect('clicked',self.sp_parents_clicked) + if not already_init: + self.top.get_widget('add_parents2').connect('clicked',self.add_parents_clicked) + self.top.get_widget('del_parents2').connect('clicked',self.del_parents_clicked) + self.top.get_widget('add_spparents2').connect('clicked',self.add_sp_parents) + self.top.get_widget('del_spparents2').connect('clicked',self.del_sp_parents) + self.top.get_widget('fam_back2').connect('clicked',self.child_back) + self.top.get_widget('del_child_btn2').connect('clicked',self.remove_child_clicked) + self.top.get_widget('add_child_btn2').connect('clicked',self.add_child_clicked) + self.top.get_widget('select_child2').connect('clicked',self.select_child_clicked) + self.top.get_widget('ap_parents_btn2').connect('clicked',self.ap_parents_clicked) + self.top.get_widget('sp_parents_btn2').connect('clicked',self.sp_parents_clicked) self.parent.views.get_nth_page(2).show_all() if self.parent.views.get_current_page() == 1: self.parent.views.set_current_page(2) @@ -104,16 +106,17 @@ class FamilyView: self.select_spouse_btn = self.top.get_widget('select_spouse') self.remove_spouse_btn = self.top.get_widget('remove_spouse') self.child_list = self.top.get_widget('chlist') - self.top.get_widget('add_parents').connect('clicked',self.add_parents_clicked) - self.top.get_widget('del_parents').connect('clicked',self.del_parents_clicked) - self.top.get_widget('add_spparents').connect('clicked',self.add_sp_parents) - self.top.get_widget('del_spparents').connect('clicked',self.del_sp_parents) - self.top.get_widget('fam_back').connect('clicked',self.child_back) - self.top.get_widget('del_child_btn').connect('clicked',self.remove_child_clicked) - self.top.get_widget('add_child_btn').connect('clicked',self.add_child_clicked) - self.top.get_widget('select_child').connect('clicked',self.select_child_clicked) - self.top.get_widget('ap_parents_btn').connect('clicked',self.ap_parents_clicked) - self.top.get_widget('sp_parents_btn').connect('clicked',self.sp_parents_clicked) + if not already_init: + self.top.get_widget('add_parents').connect('clicked',self.add_parents_clicked) + self.top.get_widget('del_parents').connect('clicked',self.del_parents_clicked) + self.top.get_widget('add_spparents').connect('clicked',self.add_sp_parents) + self.top.get_widget('del_spparents').connect('clicked',self.del_sp_parents) + self.top.get_widget('fam_back').connect('clicked',self.child_back) + self.top.get_widget('del_child_btn').connect('clicked',self.remove_child_clicked) + self.top.get_widget('add_child_btn').connect('clicked',self.add_child_clicked) + self.top.get_widget('select_child').connect('clicked',self.select_child_clicked) + self.top.get_widget('ap_parents_btn').connect('clicked',self.ap_parents_clicked) + self.top.get_widget('sp_parents_btn').connect('clicked',self.sp_parents_clicked) self.parent.views.get_nth_page(1).show_all() if self.parent.views.get_current_page() == 2: self.parent.views.set_current_page(1) diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 33e8e8890..f9bb09936 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -242,7 +242,7 @@ def loadConfig(call): status_bar = get_int("/apps/gramps/statusbar") gnome_toolbar_str = get_string("/desktop/gnome/interface/toolbar_style") gnome_toolbar = eval("gtk.TOOLBAR_%s" % string.upper(gnome_toolbar_str)) - save_toolbar = get_int("/apps/gramps/toolbar",gtk.TOOLBAR_BOTH) + save_toolbar = get_int("/apps/gramps/toolbar",5) if save_toolbar == 5: toolbar = gnome_toolbar else: @@ -326,24 +326,24 @@ def loadConfig(call): def get_string(value,defval=""): v = client.get_string(value) - if v == None: - return defval - else: + if client.get(key): return v + else: + return defval def get_bool(key,defval=0): v = client.get_bool(key) - if v == None: - return defval - else: + if client.get(key): return v + else: + return defval def get_int(key,defval=0): v = client.get_int(key) - if v == None: - return defval - else: + if client.get(key): return v + else: + return defval def set_int(key,value): client.set_int(key,value)