(needed for Family View). Enable switching Toolbar on/off.
Correct existing gconf key detection. Enable switching Toolbar on/off. * src/gramps.glade: Enable switching Toolbar on/off. svn: r2266
This commit is contained in:
		| @@ -8,12 +8,13 @@ | ||||
| 	* 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). | ||||
| 	(needed for Family View). Enable switching Toolbar on/off. | ||||
| 	* 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. | ||||
| 	Correct existing gconf key detection. Enable switching Toolbar on/off. | ||||
| 	* src/gramps.glade: Enable switching Toolbar on/off.  | ||||
|  | ||||
| 2003-10-15  Alex Roitman  <shura@alex.neuro.umn.edu> | ||||
| 	* src/gramps.glade: Correct tooltips.  | ||||
|   | ||||
| @@ -1026,6 +1026,7 @@ def display_preferences_box(db): | ||||
|     GrampsPreferences(db) | ||||
|  | ||||
| _view_str = "/apps/gramps/view" | ||||
| _toolbar_str = "/apps/gramps/toolbar-on" | ||||
|  | ||||
| def save_view(val): | ||||
|     set_bool(_view_str, not val) | ||||
| @@ -1040,4 +1041,9 @@ def save_filter(val): | ||||
| def get_filter(): | ||||
|     return get_bool("/apps/gramps/filter") | ||||
|  | ||||
| def save_toolbar_on(val): | ||||
|     set_bool(_toolbar_str, not val) | ||||
|     sync() | ||||
|  | ||||
| def get_toolbar_on(): | ||||
|     return not client.get_bool(_toolbar_str) | ||||
|   | ||||
| @@ -51,7 +51,7 @@ | ||||
| 			  <accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1512"> | ||||
| 			    <widget class="GtkImage" id="image1550"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-new</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -73,7 +73,7 @@ | ||||
| 			  <accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1513"> | ||||
| 			    <widget class="GtkImage" id="image1551"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-open</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -95,7 +95,7 @@ | ||||
| 			  <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1514"> | ||||
| 			    <widget class="GtkImage" id="image1552"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-save</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -116,7 +116,7 @@ | ||||
| 			  <signal name="activate" handler="on_save_as_activate" last_modification_time="Tue, 01 Apr 2003 03:50:28 GMT"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1515"> | ||||
| 			    <widget class="GtkImage" id="image1553"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-save-as</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -150,7 +150,7 @@ | ||||
| 			  <property name="use_underline">True</property> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1516"> | ||||
| 			    <widget class="GtkImage" id="image1554"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-convert</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -171,7 +171,7 @@ | ||||
| 			  <signal name="activate" handler="on_revert_activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1517"> | ||||
| 			    <widget class="GtkImage" id="image1555"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-revert-to-saved</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -192,7 +192,7 @@ | ||||
| 			  <signal name="activate" handler="on_reload_plugins_activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1518"> | ||||
| 			    <widget class="GtkImage" id="image1556"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-refresh</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -220,7 +220,7 @@ | ||||
| 			  <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1519"> | ||||
| 			    <widget class="GtkImage" id="image1557"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-quit</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -256,7 +256,7 @@ | ||||
| 			  <accelerator key="Insert" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1520"> | ||||
| 			    <widget class="GtkImage" id="image1558"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-add</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -279,7 +279,7 @@ | ||||
| 			  <accelerator key="Delete" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1521"> | ||||
| 			    <widget class="GtkImage" id="image1559"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-remove</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -317,7 +317,7 @@ | ||||
| 			  <accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1522"> | ||||
| 			    <widget class="GtkImage" id="image1560"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-find</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -339,7 +339,7 @@ | ||||
| 			  <accelerator key="M" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1523"> | ||||
| 			    <widget class="GtkImage" id="image1561"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-convert</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -365,6 +365,16 @@ | ||||
| 		  <child> | ||||
| 		    <widget class="GtkMenu" id="view1_menu"> | ||||
|  | ||||
| 		      <child> | ||||
| 			<widget class="GtkCheckMenuItem" id="filter1"> | ||||
| 			  <property name="visible">True</property> | ||||
| 			  <property name="label" translatable="yes">_Filter</property> | ||||
| 			  <property name="use_underline">True</property> | ||||
| 			  <property name="active">True</property> | ||||
| 			  <signal name="activate" handler="on_filter1_activate" last_modification_time="Thu, 05 Sep 2002 01:38:10 GMT"/> | ||||
| 			</widget> | ||||
| 		      </child> | ||||
|  | ||||
| 		      <child> | ||||
| 			<widget class="GtkCheckMenuItem" id="sidebar1"> | ||||
| 			  <property name="visible">True</property> | ||||
| @@ -376,12 +386,12 @@ | ||||
| 		      </child> | ||||
|  | ||||
| 		      <child> | ||||
| 			<widget class="GtkCheckMenuItem" id="filter1"> | ||||
| 			<widget class="GtkCheckMenuItem" id="toolbar2"> | ||||
| 			  <property name="visible">True</property> | ||||
| 			  <property name="label" translatable="yes">_Filter</property> | ||||
| 			  <property name="label" translatable="yes">_Toolbar</property> | ||||
| 			  <property name="use_underline">True</property> | ||||
| 			  <property name="active">True</property> | ||||
| 			  <signal name="activate" handler="on_filter1_activate" last_modification_time="Thu, 05 Sep 2002 01:38:10 GMT"/> | ||||
| 			  <signal name="activate" handler="on_toolbar2_activate" last_modification_time="Fri, 17 Oct 2003 04:41:03 GMT"/> | ||||
| 			</widget> | ||||
| 		      </child> | ||||
| 		    </widget> | ||||
| @@ -415,7 +425,7 @@ | ||||
| 			  <accelerator key="D" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1524"> | ||||
| 			    <widget class="GtkImage" id="image1562"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-index</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -437,7 +447,7 @@ | ||||
| 			  <accelerator key="B" modifiers="GDK_CONTROL_MASK" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1525"> | ||||
| 			    <widget class="GtkImage" id="image1563"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gnome-stock-book-open</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -501,7 +511,7 @@ | ||||
| 			  <signal name="activate" handler="on_preferences1_activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1526"> | ||||
| 			    <widget class="GtkImage" id="image1564"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-preferences</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -522,7 +532,7 @@ | ||||
| 			  <signal name="activate" handler="on_default_person_activate" last_modification_time="Sat, 16 Aug 2003 01:58:26 GMT"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1527"> | ||||
| 			    <widget class="GtkImage" id="image1565"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-home</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -557,7 +567,7 @@ | ||||
| 			  <accelerator key="F1" modifiers="0" signal="activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1528"> | ||||
| 			    <widget class="GtkImage" id="image1566"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-help</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -584,7 +594,7 @@ | ||||
| 			  <signal name="activate" handler="on_gramps_home_page_activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1529"> | ||||
| 			    <widget class="GtkImage" id="image1567"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gtk-jump-to</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -605,7 +615,7 @@ | ||||
| 			  <signal name="activate" handler="on_gramps_mailing_lists_activate"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1530"> | ||||
| 			    <widget class="GtkImage" id="image1568"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gnome-stock-mail</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
| @@ -659,7 +669,7 @@ | ||||
| 			  <signal name="activate" handler="on_about_activate" last_modification_time="Tue, 01 Apr 2003 03:44:24 GMT"/> | ||||
|  | ||||
| 			  <child internal-child="image"> | ||||
| 			    <widget class="GtkImage" id="image1531"> | ||||
| 			    <widget class="GtkImage" id="image1569"> | ||||
| 			      <property name="visible">True</property> | ||||
| 			      <property name="stock">gnome-stock-about</property> | ||||
| 			      <property name="icon_size">1</property> | ||||
|   | ||||
| @@ -208,6 +208,7 @@ class Gramps: | ||||
|  | ||||
|         self.sidebar_btn = self.gtop.get_widget("sidebar1") | ||||
|         self.filter_btn  = self.gtop.get_widget("filter1") | ||||
|         self.toolbar_btn = self.gtop.get_widget("toolbar2") | ||||
|         self.statusbar   = self.gtop.get_widget("statusbar") | ||||
|  | ||||
|         self.filter_list = self.gtop.get_widget("filter_list") | ||||
| @@ -215,6 +216,7 @@ class Gramps: | ||||
|         self.merge_button= self.gtop.get_widget("merge") | ||||
|         self.canvas      = self.gtop.get_widget("canvas1") | ||||
|         self.toolbar     = self.gtop.get_widget("toolbar1") | ||||
|         self.toolbardock = self.gtop.get_widget("dockitem2") | ||||
|         self.filter_text = self.gtop.get_widget('filter') | ||||
|         self.filter_inv  = self.gtop.get_widget("invert") | ||||
|         self.qual_label  = self.gtop.get_widget("qual") | ||||
| @@ -234,6 +236,9 @@ class Gramps: | ||||
|         self.use_filter = GrampsCfg.get_filter() | ||||
|         self.filter_btn.set_active(self.use_filter) | ||||
|  | ||||
|         self.use_toolbar = GrampsCfg.get_toolbar_on() | ||||
|         self.toolbar_btn.set_active(self.use_toolbar) | ||||
|  | ||||
|         self.child_model = gtk.ListStore( | ||||
|             gobject.TYPE_INT, gobject.TYPE_STRING, gobject.TYPE_STRING, | ||||
|             gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,  | ||||
| @@ -312,6 +317,7 @@ class Gramps: | ||||
|             "on_media_list_drag_data_received" : self.media_view.on_drag_data_received, | ||||
|             "on_merge_activate" : self.on_merge_activate, | ||||
|             "on_sidebar1_activate" : self.on_sidebar_activate, | ||||
|             "on_toolbar2_activate" : self.on_toolbar_activate, | ||||
|             "on_filter1_activate" : self.on_filter_activate, | ||||
|             "on_places_activate" : self.on_places_activate, | ||||
|             "on_preferences1_activate" : self.on_preferences_activate, | ||||
| @@ -351,6 +357,7 @@ class Gramps: | ||||
|         self.forward = gtk.ImageMenuItem(gtk.STOCK_GO_BACK) | ||||
|  | ||||
|         self.topWindow.show() | ||||
|         self.enable_toolbar(self.use_toolbar) | ||||
|  | ||||
|     def redraw_histmenu(self): | ||||
|         """Create the history submenu of the Go menu""" | ||||
| @@ -610,6 +617,17 @@ class Gramps: | ||||
|         self.enable_filter(obj.get_active()) | ||||
|         GrampsCfg.save_filter(obj.get_active()) | ||||
|  | ||||
|     def on_toolbar_activate(self,obj): | ||||
|         val = obj.get_active() | ||||
|         self.enable_toolbar(val) | ||||
|  | ||||
|     def enable_toolbar(self,val): | ||||
|         if val: | ||||
|             self.toolbardock.show() | ||||
|         else: | ||||
|             self.toolbardock.hide() | ||||
|         GrampsCfg.save_toolbar_on(val) | ||||
|  | ||||
|     def build_plugin_menus(self): | ||||
|         export_menu = self.gtop.get_widget("export1") | ||||
|         import_menu = self.gtop.get_widget("import1") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user