From a3694c57e0eed045b727c0086360999b0dfe27f3 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 17 Oct 2003 05:05:20 +0000 Subject: [PATCH] (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 --- ChangeLog | 5 +++-- src/GrampsCfg.py | 6 +++++ src/gramps.glade | 56 +++++++++++++++++++++++++++------------------- src/gramps_main.py | 18 +++++++++++++++ 4 files changed, 60 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40e113e00..90efe7165 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 * src/gramps.glade: Correct tooltips. diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 38427b08e..f9aed7289 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -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) diff --git a/src/gramps.glade b/src/gramps.glade index 8e0659487..d57f202cd 100644 --- a/src/gramps.glade +++ b/src/gramps.glade @@ -51,7 +51,7 @@ - + True gtk-new 1 @@ -73,7 +73,7 @@ - + True gtk-open 1 @@ -95,7 +95,7 @@ - + True gtk-save 1 @@ -116,7 +116,7 @@ - + True gtk-save-as 1 @@ -150,7 +150,7 @@ True - + True gtk-convert 1 @@ -171,7 +171,7 @@ - + True gtk-revert-to-saved 1 @@ -192,7 +192,7 @@ - + True gtk-refresh 1 @@ -220,7 +220,7 @@ - + True gtk-quit 1 @@ -256,7 +256,7 @@ - + True gtk-add 1 @@ -279,7 +279,7 @@ - + True gtk-remove 1 @@ -317,7 +317,7 @@ - + True gtk-find 1 @@ -339,7 +339,7 @@ - + True gtk-convert 1 @@ -365,6 +365,16 @@ + + + True + _Filter + True + True + + + + True @@ -376,12 +386,12 @@ - + True - _Filter + _Toolbar True True - + @@ -415,7 +425,7 @@ - + True gtk-index 1 @@ -437,7 +447,7 @@ - + True gnome-stock-book-open 1 @@ -501,7 +511,7 @@ - + True gtk-preferences 1 @@ -522,7 +532,7 @@ - + True gtk-home 1 @@ -557,7 +567,7 @@ - + True gtk-help 1 @@ -584,7 +594,7 @@ - + True gtk-jump-to 1 @@ -605,7 +615,7 @@ - + True gnome-stock-mail 1 @@ -659,7 +669,7 @@ - + True gnome-stock-about 1 diff --git a/src/gramps_main.py b/src/gramps_main.py index 0e144e1e7..e41c342d3 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -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")