[Xfce4-commits] <xfce4-panel:devel> Use custom bindings in systray plugin.
Nick Schermer
nick at xfce.org
Tue Aug 11 20:34:21 CEST 2009
Updating branch refs/heads/devel
to bed3546311af42c35be65ae409b5fbc3fcddfe2f (commit)
from 8b88b46cae1729ee9a30463f532388cea453be8c (commit)
commit bed3546311af42c35be65ae409b5fbc3fcddfe2f
Author: Nick Schermer <nick at xfce.org>
Date: Mon Jun 1 00:56:11 2009 +0200
Use custom bindings in systray plugin.
plugins/systray/Makefile.am | 4 +++-
plugins/systray/systray.c | 20 +++++++++++++-------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/plugins/systray/Makefile.am b/plugins/systray/Makefile.am
index 6c4df99..ef23eda 100644
--- a/plugins/systray/Makefile.am
+++ b/plugins/systray/Makefile.am
@@ -44,6 +44,7 @@ libsystray_la_LDFLAGS = \
libsystray_la_LIBADD = \
$(top_builddir)/libxfce4panel/libxfce4panel.la \
+ $(top_builddir)/common/libpanel-xfconf.la \
$(LIBX11_LIBS) \
$(GTK_LIBS) \
$(EXO_LIBS) \
@@ -52,7 +53,8 @@ libsystray_la_LIBADD = \
$(LIBXFCE4UI_LIBS)
libsystray_la_DEPENDENCIES = \
- $(top_builddir)/libxfce4panel/libxfce4panel.la
+ $(top_builddir)/libxfce4panel/libxfce4panel.la \
+ $(top_builddir)/common/libpanel-xfconf.la
#
# .desktop file
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index 9774016..43221a4 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -25,6 +25,7 @@
#include <libxfce4util/libxfce4util.h>
#include <libxfce4ui/libxfce4ui.h>
#include <common/panel-private.h>
+#include <common/panel-xfconf.h>
#include <xfconf/xfconf.h>
#include <exo/exo.h>
@@ -296,16 +297,21 @@ systray_plugin_screen_changed (GtkWidget *widget,
static void
systray_plugin_construct (XfcePanelPlugin *panel_plugin)
{
- SystrayPlugin *plugin = XFCE_SYSTRAY_PLUGIN (panel_plugin);
+ SystrayPlugin *plugin = XFCE_SYSTRAY_PLUGIN (panel_plugin);
+ const PanelProperty properties[] =
+ {
+ { "rows", G_TYPE_UINT },
+ { "show-frame", G_TYPE_BOOLEAN },
+ { NULL, G_TYPE_NONE }
+ };
/* open the xfconf channel */
- plugin->channel = xfce_panel_plugin_xfconf_channel_new (panel_plugin);
+ plugin->channel = xfconf_channel_new (XFCE_PANEL_PLUGIN_CHANNEL_NAME);
- /* bind the properties */
- xfconf_g_property_bind (plugin->channel, "/rows",
- G_TYPE_UINT, plugin, "rows");
- xfconf_g_property_bind (plugin->channel, "/show-frame",
- G_TYPE_BOOLEAN, plugin, "show-frame");
+ /* bind all properties */
+ panel_properties_bind (plugin->channel, G_OBJECT (plugin),
+ xfce_panel_plugin_get_property_base (panel_plugin),
+ properties, NULL);
/* monitor screen changes */
g_signal_connect (G_OBJECT (plugin), "screen-changed",
More information about the Xfce4-commits
mailing list