[Xfce4-commits] <xfce4-panel:devel> Put some launcher properties bindings in a loop.

Nick Schermer nick at xfce.org
Tue Aug 11 20:34:44 CEST 2009


Updating branch refs/heads/devel
         to 994c53033af1b44596eb59ac7359f4d7dda1d9d3 (commit)
       from 9b67c9b5a23ffdb2a86281d7023273ece21dedf3 (commit)

commit 994c53033af1b44596eb59ac7359f4d7dda1d9d3
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Jun 7 18:37:45 2009 +0200

    Put some launcher properties bindings in a loop.

 plugins/launcher/launcher-dialog.c |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
index bd2fec4..3c0ff2e 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -644,6 +644,8 @@ launcher_dialog_show (LauncherPlugin *plugin)
   const gchar          *button_names[] = { "item-add", "item-delete",
                                            "item-move-up", "item-move-down",
                                            "item-edit", "item-new" };
+  const gchar          *binding_names[] = { "disable-tooltips", /* "show-labels", */
+                                            "move-first", "arrow-position" };
 
   panel_return_if_fail (XFCE_IS_LAUNCHER_PLUGIN (plugin));
 
@@ -669,8 +671,9 @@ launcher_dialog_show (LauncherPlugin *plugin)
       for (i = 0; i < G_N_ELEMENTS (button_names); i++)
         {
           object = gtk_builder_get_object (builder, button_names[i]);
+          panel_return_if_fail (GTK_IS_WIDGET (object));
           g_signal_connect (G_OBJECT (object), "clicked",
-                            G_CALLBACK (launcher_dialog_item_button_clicked), dialog);
+              G_CALLBACK (launcher_dialog_item_button_clicked), dialog);
         }
 
       /* setup treeview selection */
@@ -682,22 +685,13 @@ launcher_dialog_show (LauncherPlugin *plugin)
       launcher_dialog_tree_selection_changed (selection, dialog);
 
       /* connect binding to the advanced properties */
-      object = gtk_builder_get_object (builder, "disable-tooltips");
-      exo_mutual_binding_new (G_OBJECT (plugin), "disable-tooltips",
-                              G_OBJECT (object), "active");
-#if 0
-      /* TODO */
-      object = gtk_builder_get_object (builder, "show-labels");
-      exo_mutual_binding_new (G_OBJECT (plugin), "show-labels",
-                              G_OBJECT (object), "active");
-#endif
-      object = gtk_builder_get_object (builder, "move-first");
-      exo_mutual_binding_new (G_OBJECT (plugin), "move-first",
-                              G_OBJECT (object), "active");
-
-      object = gtk_builder_get_object (builder, "arrow-position");
-      exo_mutual_binding_new (G_OBJECT (plugin), "arrow-position",
-                              G_OBJECT (object), "active");
+      for (i = 0; i < G_N_ELEMENTS (binding_names); i++)
+        {
+          object = gtk_builder_get_object (builder, binding_names[i]);
+          panel_return_if_fail (GTK_IS_WIDGET (object));
+          exo_mutual_binding_new (G_OBJECT (plugin), binding_names[i],
+                                  G_OBJECT (object), "active");
+        }
 
       /* setup responses for the other dialogs */
       object = gtk_builder_get_object (builder, "dialog-editor");



More information about the Xfce4-commits mailing list