From a9c28c392cd94a2d6b65ebff61ffed9ffa311953 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 16 Oct 2003 16:43:07 +0000 Subject: [PATCH] * src/GrampsCfg.py: Implement instant preferences (HIG). * src/preferences.glade: Likewise. * src/gramps_main.py (pref_callback): Update statusbar from prefs (needed for Family View). svn: r2260 --- ChangeLog | 6 ++++++ src/GrampsCfg.py | 16 ++++++---------- src/gramps_main.py | 2 +- src/preferences.glade | 29 +---------------------------- 4 files changed, 14 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 358d1c141..86636f834 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-10-16 Alex Roitman + * src/GrampsCfg.py: Implement instant preferences (HIG). + * src/preferences.glade: Likewise. + * src/gramps_main.py (pref_callback): Update statusbar from prefs + (needed for Family View). + 2003-10-15 Alex Roitman * src/gramps.glade: Correct tooltips. * src/GrampsCfg.py: Enable using four toolbar styles as well as diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index dee02054f..33e8e8890 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -522,19 +522,17 @@ def add_checkbox(category,panel,frame,config_tag,label,default): #------------------------------------------------------------------------- class GrampsPreferences: def __init__(self,db): + self.built = 0 self.db = db self.top = gtk.glade.XML(const.prefsFile,"preferences","gramps") self.top.signal_autoconnect({ "on_close_clicked" : self.on_close_clicked, - "on_ok_clicked" : self.on_ok_clicked, - "on_apply_clicked" : self.on_propertybox_apply, "on_help_clicked" : self.on_propertybox_help, "on_object_toggled" : self.on_object_toggled, "on_tree_select_row" : self.select }) self.window = self.top.get_widget("preferences") - self.apply = self.top.get_widget("apply") self.tree = self.top.get_widget("tree") self.store = gtk.TreeStore(gobject.TYPE_STRING) self.selection = self.tree.get_selection() @@ -550,7 +548,7 @@ class GrampsPreferences: self.build_tree() self.build() self.build_ext() - self.apply.set_sensitive(0) + self.built = 1 self.window.show() def build_tree(self): @@ -804,10 +802,6 @@ class GrampsPreferences: def on_close_clicked(self,obj): Utils.destroy_passed_object(self.window) - def on_ok_clicked(self,obj): - self.on_propertybox_apply(obj) - Utils.destroy_passed_object(self.window) - def on_propertybox_apply(self,obj): global nameof global uselds @@ -1014,12 +1008,14 @@ class GrampsPreferences: def on_object_toggled(self,obj): """Called by the elements on the property box to set the changed flag, so that the property box knows to set the Apply button""" - self.apply.set_sensitive(1) + if self.built: + self.on_propertybox_apply(obj) def on_format_toggled(self,obj): """Called by the elements on the property box to set the changed flag, so that the property box knows to set the Apply button""" - self.apply.set_sensitive(1) + if self.built: + self.on_propertybox_apply(obj) #------------------------------------------------------------------------- # diff --git a/src/gramps_main.py b/src/gramps_main.py index ab52c37b8..0e144e1e7 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -169,11 +169,11 @@ class Gramps: self.db.setResearcher(GrampsCfg.get_researcher()) def pref_callback(self,val): + self.modify_statusbar() self.family_view.init_interface() self.update_display(val) self.toolbar.set_style(GrampsCfg.toolbar) - def init_interface(self): """Initializes the GLADE interface, and gets references to the widgets that it will need. diff --git a/src/preferences.glade b/src/preferences.glade index d3042d387..41c5d952e 100644 --- a/src/preferences.glade +++ b/src/preferences.glade @@ -26,20 +26,6 @@ True GTK_BUTTONBOX_END - - - True - False - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - 0 - - - - True @@ -52,19 +38,6 @@ - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - 0 - - - 0 @@ -768,7 +741,7 @@ True True 0 - +