* 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
This commit is contained in:
Alex Roitman 2003-10-16 16:43:07 +00:00
parent b7cfa1a6b4
commit b33e8c95cc
4 changed files with 14 additions and 39 deletions

View File

@ -1,3 +1,9 @@
2003-10-16 Alex Roitman <shura@alex.neuro.umn.edu>
* 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 <shura@alex.neuro.umn.edu>
* src/gramps.glade: Correct tooltips.
* src/GrampsCfg.py: Enable using four toolbar styles as well as

View File

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

View File

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

View File

@ -26,20 +26,6 @@
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="apply">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-apply</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_apply_clicked"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button6">
<property name="visible">True</property>
@ -52,19 +38,6 @@
<signal name="clicked" handler="on_close_clicked"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button4">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_ok_clicked"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
@ -768,7 +741,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="history">0</property>
<signal name="changed" handler="on_object_toggled" object="propertybox" last_modification_time="Thu, 16 Oct 2003 03:13:45 GMT"/>
<signal name="changed" handler="on_object_toggled" object="propertybox" last_modification_time="Thu, 16 Oct 2003 16:14:49 GMT"/>
<child>
<widget class="GtkMenu" id="menu3">