diff options
author | Ted Gould <ted@gould.cx> | 2010-05-19 11:41:27 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-05-19 11:41:27 -0500 |
commit | 69996154dbde58371e67ab88b8eb16dd5decca2d (patch) | |
tree | b6fea004f4c96dd6a934f00e6bef95ec504c0960 | |
parent | 8d461077788a54834bb7770fb19af119ae41eb32 (diff) | |
download | ayatana-indicator-datetime-69996154dbde58371e67ab88b8eb16dd5decca2d.tar.gz ayatana-indicator-datetime-69996154dbde58371e67ab88b8eb16dd5decca2d.tar.bz2 ayatana-indicator-datetime-69996154dbde58371e67ab88b8eb16dd5decca2d.zip |
Switching the menu to be from the service.
-rw-r--r-- | src/indicator-datetime.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 448d736..f114476 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -12,6 +12,9 @@ #include <libindicator/indicator-object.h> #include <libindicator/indicator-service-manager.h> +/* DBusMenu */ +#include <libdbusmenu-gtk/menu.h> + #include "dbus-shared.h" @@ -45,6 +48,7 @@ struct _IndicatorDatetimePrivate { gint max_width; IndicatorServiceManager * sm; + DbusmenuGtkMenu * menu; }; #define INDICATOR_DATETIME_GET_PRIVATE(o) \ @@ -97,6 +101,7 @@ indicator_datetime_init (IndicatorDatetime *self) self->priv->max_width = 0; self->priv->sm = NULL; + self->priv->menu = NULL; self->priv->sm = indicator_service_manager_new_version(SERVICE_NAME, SERVICE_VERSION); @@ -133,6 +138,11 @@ indicator_datetime_dispose (GObject *object) self->priv->idle_measure = 0; } + if (self->priv->menu != NULL) { + g_object_unref(G_OBJECT(self->priv->menu)); + self->priv->menu = NULL; + } + if (self->priv->sm != NULL) { g_object_unref(G_OBJECT(self->priv->sm)); self->priv->sm = NULL; @@ -348,6 +358,12 @@ get_menu (IndicatorObject * io) { IndicatorDatetime * self = INDICATOR_DATETIME(io); + if (self->priv->menu == NULL) { + self->priv->menu = dbusmenu_gtkmenu_new(SERVICE_NAME, MENU_OBJ); + } + + return GTK_MENU(self->priv->menu); + GtkWidget * menu = NULL; GtkWidget * item = NULL; |