[gnome-utils/gsettings-tutorial: 5/22] [gsettings-tutorial] Bind the toggle toolbar action to the setting key



commit 1b58ba2e673df7ddcdb66c1916330e6f7432ad74
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Apr 16 15:15:21 2010 -0400

    [gsettings-tutorial] Bind the toggle toolbar action to the setting key

 baobab/data/baobab-main-window.ui |    1 -
 baobab/src/baobab.c               |    3 +++
 baobab/src/callbacks.c            |   14 --------------
 baobab/src/callbacks.h            |    1 -
 4 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/baobab/data/baobab-main-window.ui b/baobab/data/baobab-main-window.ui
index 55f6215..841cce8 100644
--- a/baobab/data/baobab-main-window.ui
+++ b/baobab/data/baobab-main-window.ui
@@ -106,7 +106,6 @@
             <property name="active">True</property>
             <property name="name">view_tb</property>
             <property name="label" translatable="yes">_Toolbar</property>
-            <signal handler="on_view_tb_activate" last_modification_time="Wed, 19 Apr 2006 12:10:25 GMT" name="activate"/>
           </object>
         </child>
         <child>
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c
index 4da7b59..57493a1 100644
--- a/baobab/src/baobab.c
+++ b/baobab/src/baobab.c
@@ -842,6 +842,9 @@ baobab_init (void)
 	g_settings_bind (baobab.settings_ui, "toolbar_visible",
 			 baobab.toolbar, "visible",
 			 G_SETTINGS_BIND_DEFAULT);
+	g_settings_bind (baobab.settings_ui, "toolbar_visible",
+			 GTK_TOGGLE_ACTION (gtk_builder_get_object (baobab.main_ui, "view_tb")), "active",
+			 G_SETTINGS_BIND_DEFAULT);
 }
 
 static void
diff --git a/baobab/src/callbacks.c b/baobab/src/callbacks.c
index d13ffca..7673210 100644
--- a/baobab/src/callbacks.c
+++ b/baobab/src/callbacks.c
@@ -269,20 +269,6 @@ on_ck_allocated_activate (GtkToggleAction *action,
 }
 
 void
-on_view_tb_activate (GtkToggleAction *action,
-                     gpointer         user_data) 
-{
-	gboolean visible;
-
-	visible = gtk_toggle_action_get_active (action);
-
-	gconf_client_set_bool (baobab.gconf_client,
-			       BAOBAB_TOOLBAR_VISIBLE_KEY,
-			       visible,
-			       NULL);
-}
-
-void
 on_view_sb_activate (GtkToggleAction *action,
                      gpointer         user_data) 
 {
diff --git a/baobab/src/callbacks.h b/baobab/src/callbacks.h
index 72aff34..a5b6079 100644
--- a/baobab/src/callbacks.h
+++ b/baobab/src/callbacks.h
@@ -48,7 +48,6 @@ void list_all_cb (GtkMenuItem *pmenu, gpointer dummy);
 void on_pref_menu (GtkAction *a, gpointer user_data);
 void on_tb_scan_remote_clicked (GtkToolButton *toolbutton, gpointer user_data);
 void on_menu_scan_rem_activate (GtkMenuItem *menuitem, gpointer user_data);
-void on_view_tb_activate (GtkToggleAction *action, gpointer user_data); 
 void on_view_sb_activate (GtkToggleAction *action, gpointer         user_data);
 void on_ck_allocated_activate (GtkToggleAction *action, gpointer user_data);
 void on_helpcontents_activate (GtkAction *a, gpointer user_data);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]