[Xfce4-commits] <xfce4-panel:devel> Use custom bindings in pager plugin.
Nick Schermer
nick at xfce.org
Tue Aug 11 20:34:19 CEST 2009
Updating branch refs/heads/devel
to 71809611397ed9522ecf83de0ff55761649c4f34 (commit)
from b1512148dbc9d0820ebe56c901df08cc6e1f5302 (commit)
commit 71809611397ed9522ecf83de0ff55761649c4f34
Author: Nick Schermer <nick at xfce.org>
Date: Mon Jun 1 00:55:23 2009 +0200
Use custom bindings in pager plugin.
plugins/pager/Makefile.am | 4 +++-
plugins/pager/pager.c | 27 ++++++++++++++++-----------
2 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/plugins/pager/Makefile.am b/plugins/pager/Makefile.am
index a92b1ce..f5a6c0c 100644
--- a/plugins/pager/Makefile.am
+++ b/plugins/pager/Makefile.am
@@ -37,6 +37,7 @@ libpager_la_LDFLAGS = \
libpager_la_LIBADD = \
$(top_builddir)/libxfce4panel/libxfce4panel.la \
+ $(top_builddir)/common/libpanel-xfconf.la \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(LIBWNCK_LIBS) \
@@ -45,7 +46,8 @@ libpager_la_LIBADD = \
$(LIBXFCE4UI_LIBS)
libpager_la_DEPENDENCIES = \
- $(top_builddir)/libxfce4panel/libxfce4panel.la
+ $(top_builddir)/libxfce4panel/libxfce4panel.la \
+ $(top_builddir)/common/libpanel-xfconf.la
#
# .desktop file
diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c
index 2a5c700..e7ead78 100644
--- a/plugins/pager/pager.c
+++ b/plugins/pager/pager.c
@@ -26,6 +26,7 @@
#include <libxfce4panel/libxfce4panel.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
+#include <common/panel-xfconf.h>
#include <xfconf/xfconf.h>
#include <libwnck/libwnck.h>
#include <exo/exo.h>
@@ -309,17 +310,21 @@ static void
pager_plugin_construct (XfcePanelPlugin *panel_plugin)
{
PagerPlugin *plugin = XFCE_PAGER_PLUGIN (panel_plugin);
-
- /* set the xfconf channel */
- plugin->channel = xfce_panel_plugin_xfconf_channel_new (panel_plugin);
-
- /* bind properties */
- xfconf_g_property_bind (plugin->channel, "/workspace-scrolling",
- G_TYPE_BOOLEAN, plugin, "workspace-scrolling");
- xfconf_g_property_bind (plugin->channel, "/show-names",
- G_TYPE_BOOLEAN, plugin, "show-names");
- xfconf_g_property_bind (plugin->channel, "/rows",
- G_TYPE_UINT, plugin, "rows");
+ const PanelProperty properties[] =
+ {
+ { "workspace-scrolling", G_TYPE_BOOLEAN },
+ { "show-names", G_TYPE_BOOLEAN },
+ { "rows", G_TYPE_UINT },
+ { NULL, G_TYPE_NONE }
+ };
+
+ /* open the xfconf channel */
+ 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);
/* create the pager */
g_signal_connect (G_OBJECT (plugin), "screen-changed",
More information about the Xfce4-commits
mailing list