[Xfce4-commits] <xfce4-panel:devel> Use custom bindings in launcher plugin.

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


Updating branch refs/heads/devel
         to b1512148dbc9d0820ebe56c901df08cc6e1f5302 (commit)
       from fbb8cbb77097ea2e71d2f8d913226b59fbe6498b (commit)

commit b1512148dbc9d0820ebe56c901df08cc6e1f5302
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Jun 1 00:54:59 2009 +0200

    Use custom bindings in launcher plugin.

 plugins/launcher/Makefile.am |    4 +++-
 plugins/launcher/launcher.c  |   26 +++++++++++++++-----------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/plugins/launcher/Makefile.am b/plugins/launcher/Makefile.am
index 7a2e451..501ebd2 100644
--- a/plugins/launcher/Makefile.am
+++ b/plugins/launcher/Makefile.am
@@ -43,6 +43,7 @@ liblauncher_la_LDFLAGS = \
 
 liblauncher_la_LIBADD = \
 	$(top_builddir)/libxfce4panel/libxfce4panel.la \
+	$(top_builddir)/common/libpanel-xfconf.la \
 	$(GTK_LIBS) \
 	$(LIBXFCE4UTIL_LIBS) \
 	$(LIBXFCE4UI_LIBS) \
@@ -52,7 +53,8 @@ liblauncher_la_LIBADD = \
 	$(XFCONF_LIBS)
 
 liblauncher_la_DEPENDENCIES = \
-	$(top_builddir)/libxfce4panel/libxfce4panel.la
+	$(top_builddir)/libxfce4panel/libxfce4panel.la \
+	$(top_builddir)/common/libpanel-xfconf.la
 
 #
 # .desktop file
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 07a30da..0ef8f6a 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -31,6 +31,7 @@
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4ui/libxfce4ui.h>
 #include <common/panel-private.h>
+#include <common/panel-xfconf.h>
 
 #include "launcher.h"
 #include "launcher-dialog.h"
@@ -503,19 +504,22 @@ launcher_plugin_construct (XfcePanelPlugin *panel_plugin)
   guint                i;
   GPtrArray           *array;
   GValue              *value;
+  const PanelProperty  properties[] =
+  {
+    { "items", LAUNCHER_TYPE_PTR_ARRAY },
+    { "disable-tooltips", G_TYPE_BOOLEAN },
+    { "move-first", G_TYPE_BOOLEAN },
+    { "arrow-position", G_TYPE_UINT },
+    { NULL, G_TYPE_NONE }
+  };
 
   /* open the xfconf channel */
-  plugin->channel = xfce_panel_plugin_xfconf_channel_new (panel_plugin);
-
-  /* bind properties */
-  xfconf_g_property_bind (plugin->channel, "/items",
-                          LAUNCHER_TYPE_PTR_ARRAY, plugin, "items");
-  xfconf_g_property_bind (plugin->channel, "/disable-tooltips",
-                          G_TYPE_BOOLEAN, plugin, "disable-tooltips");
-  xfconf_g_property_bind (plugin->channel, "/move-first",
-                          G_TYPE_BOOLEAN, plugin, "move-first");
-  xfconf_g_property_bind (plugin->channel, "/arrow-position",
-                          G_TYPE_UINT, plugin, "arrow-position");
+  plugin->channel = xfconf_channel_new (XFCE_PANEL_PLUGIN_CHANNEL_NAME);
+
+  /* bind all properties */
+  panel_properties_bind (plugin->channel, G_OBJECT (plugin),
+                         xfce_panel_plugin_get_property_base (panel_plugin),
+                         properties, NULL);
 
   /* handle and empty plugin */
   if (G_UNLIKELY (plugin->items == NULL))



More information about the Xfce4-commits mailing list