aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-session.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-11 14:53:20 -0600
committerTed Gould <ted@gould.cx>2010-02-11 14:53:20 -0600
commita36272659c9dbcff0c083a2083417ac65d876c3b (patch)
tree377030bc1913765af709db036d5b79ffed5b2bbf /src/indicator-session.c
parent51ac202d7332f31df4912290bb180e2b4a7d413d (diff)
downloadayatana-indicator-session-a36272659c9dbcff0c083a2083417ac65d876c3b.tar.gz
ayatana-indicator-session-a36272659c9dbcff0c083a2083417ac65d876c3b.tar.bz2
ayatana-indicator-session-a36272659c9dbcff0c083a2083417ac65d876c3b.zip
Setting up the type handler
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r--src/indicator-session.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c
index 840965e..a1f83d1 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -33,6 +33,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libindicator/indicator-service-manager.h>
#include "dbus-shared-names.h"
+#include "dbusmenu-shared.h"
#define INDICATOR_SESSION_TYPE (indicator_session_get_type ())
#define INDICATOR_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SESSION_TYPE, IndicatorSession))
@@ -65,6 +66,7 @@ INDICATOR_SET_TYPE(INDICATOR_SESSION_TYPE)
static GtkLabel * get_label (IndicatorObject * io);
static GtkImage * get_icon (IndicatorObject * io);
static GtkMenu * get_menu (IndicatorObject * io);
+static gboolean build_menu_switch (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
static void indicator_session_class_init (IndicatorSessionClass *klass);
static void indicator_session_init (IndicatorSession *self);
@@ -101,6 +103,9 @@ indicator_session_init (IndicatorSession *self)
self->status_image = GTK_IMAGE(gtk_image_new_from_icon_name("system-shutdown-panel", GTK_ICON_SIZE_MENU));
self->menu = dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT);
+ DbusmenuClient * client = DBUSMENU_CLIENT(dbusmenu_gtkmenu_get_client(self->menu));
+ dbusmenu_client_add_type_handler(client, MENU_SWITCH_TYPE, build_menu_switch);
+
return;
}
@@ -148,4 +153,13 @@ get_menu (IndicatorObject * io)
return GTK_MENU(INDICATOR_SESSION(io)->menu);
}
+/* This function checks to see if the user name is short enough
+ to not need ellipsing itself, or if, it will get ellipsed by
+ the standard label processor. */
+static gboolean
+build_menu_switch (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client)
+{
+
+ return FALSE;
+}