diff options
author | Martin Pitt <martin.pitt@canonical.com> | 2009-03-19 12:20:22 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@canonical.com> | 2009-03-19 12:20:22 +0100 |
commit | 4d0b74fec24d441a91770e507e67b3d3d6724003 (patch) | |
tree | 6933e32b1dadcf6a639a755dc95c8e66b37dfa7b /src/im-menu-item.c | |
parent | 30e360b4258236a9715f25cceb215f23b3ffd21b (diff) | |
parent | 9d174eba3f5dc4c7c59ae17a99d1e78cc7da7dd2 (diff) | |
download | ayatana-indicator-messages-4d0b74fec24d441a91770e507e67b3d3d6724003.tar.gz ayatana-indicator-messages-4d0b74fec24d441a91770e507e67b3d3d6724003.tar.bz2 ayatana-indicator-messages-4d0b74fec24d441a91770e507e67b3d3d6724003.zip |
* New upstream version.
- Now changes the icon based on non-IM indicators so that Evolution
works much better. (LP: #342480)
- Now the menu items are in a predictable order, alphabetical.
- The Messages for a particular client (i.e. Pidgin) are grouped with
the client they're associated with.
- Adjusting the icon size to match the new one in the Human theme.
- Adjusting the build so that all the different libraries are not
built in a versioned manner. Now it's just one .so, which is
what it should have been originally.
Diffstat (limited to 'src/im-menu-item.c')
-rw-r--r-- | src/im-menu-item.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/im-menu-item.c b/src/im-menu-item.c index b5940ac..eaf65a6 100644 --- a/src/im-menu-item.c +++ b/src/im-menu-item.c @@ -27,6 +27,13 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <gtk/gtk.h> #include "im-menu-item.h" +enum { + TIME_CHANGED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + typedef struct _ImMenuItemPrivate ImMenuItemPrivate; struct _ImMenuItemPrivate @@ -35,6 +42,8 @@ struct _ImMenuItemPrivate IndicateListenerServer * server; IndicateListenerIndicator * indicator; + glong seconds; + GtkHBox * hbox; GtkLabel * user; GtkLabel * time; @@ -92,6 +101,16 @@ im_menu_item_class_init (ImMenuItemClass *klass) object_class->dispose = im_menu_item_dispose; object_class->finalize = im_menu_item_finalize; + + signals[TIME_CHANGED] = g_signal_new(IM_MENU_ITEM_SIGNAL_TIME_CHANGED, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ImMenuItemClass, time_changed), + NULL, NULL, + g_cclosure_marshal_VOID__LONG, + G_TYPE_NONE, 1, G_TYPE_LONG); + + return; } static void @@ -104,6 +123,8 @@ im_menu_item_init (ImMenuItem *self) priv->server = NULL; priv->indicator = NULL; + priv->seconds = 0; + /* build widgets first */ priv->icon = GTK_IMAGE(gtk_image_new()); priv->user = GTK_LABEL(gtk_label_new("")); @@ -185,6 +206,8 @@ time_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateL ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self); + priv->seconds = propertydata->tv_sec; + time_t timet; struct tm * structtm; @@ -198,6 +221,8 @@ time_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateL gtk_label_set_label(priv->time, timestring); gtk_widget_show(GTK_WIDGET(priv->time)); + g_signal_emit(G_OBJECT(self), signals[TIME_CHANGED], 0, priv->seconds, TRUE); + return; } @@ -276,3 +301,10 @@ im_menu_item_new (IndicateListener * listener, IndicateListenerServer * server, return self; } + +glong +im_menu_item_get_seconds (ImMenuItem * menuitem) +{ + ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(menuitem); + return priv->seconds; +} |