From c64e0b6579cd74541775f37207b509b8e1c763a3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 26 Oct 2009 16:45:17 -0500 Subject: Adding a translators comments for minutes and hours strings. --- src/im-menu-item.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/im-menu-item.c b/src/im-menu-item.c index 35bb3be..9ea7ec7 100644 --- a/src/im-menu-item.c +++ b/src/im-menu-item.c @@ -213,6 +213,10 @@ update_time (ImMenuItem * self) } if (elapsed_minutes < 60) { + /* TRANSLATORS: This string is used to represent the number of minutes + since an IM has occured. It is in the right column + of a menu so being brief is desirable, but one character + is not a requirement. */ timestring = g_strdup_printf(ngettext("%d m", "%d m", elapsed_minutes), elapsed_minutes); } else { guint elapsed_hours = elapsed_minutes / 60; @@ -222,6 +226,10 @@ update_time (ImMenuItem * self) elapsed_hours += 1; } + /* TRANSLATORS: This string is used to represent the number of hours + since an IM has occured. It is in the right column + of a menu so being brief is desirable, but one character + is not a requirement. */ timestring = g_strdup_printf(ngettext("%d h", "%d h", elapsed_hours), elapsed_hours); } -- cgit v1.2.3 From a39cd3fda2f3bf95c811a2699bb41d98541a7197 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 4 Nov 2009 15:00:19 -0600 Subject: Requiring the new libindicator --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4b36234..3edcc3c 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ GTK_REQUIRED_VERSION=2.12 GIO_UNIX_REQUIRED_VERSION=2.18 PANEL_REQUIRED_VERSION=2.0.0 INDICATE_REQUIRED_VERSION=0.2.0 -INDICATOR_REQUIRED_VERSION=0.2.0 +INDICATOR_REQUIRED_VERSION=0.3.0 DBUSMENUGTK_REQUIRED_VERSION=0.1.1 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION -- cgit v1.2.3 From 8d98d2bb66cbfab187f47ea4d1c60f751c549f1a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 4 Nov 2009 15:20:36 -0600 Subject: Switching to the new indicator interface. --- src/indicator-messages.c | 92 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 15 deletions(-) diff --git a/src/indicator-messages.c b/src/indicator-messages.c index e7d6207..54e67c9 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -22,6 +22,7 @@ with this program. If not, see . #include #include +#include #include #include #include @@ -29,21 +30,88 @@ with this program. If not, see . #include #include -INDICATOR_SET_VERSION -INDICATOR_SET_NAME("messages") +#include #include "dbus-data.h" #include "messages-service-client.h" -static GtkWidget * main_image = NULL; +#define INDICATOR_MESSAGES_TYPE (indicator_messages_get_type ()) +#define INDICATOR_MESSAGES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_MESSAGES_TYPE, IndicatorMessages)) +#define INDICATOR_MESSAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_MESSAGES_TYPE, IndicatorMessagesClass)) +#define IS_INDICATOR_MESSAGES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_MESSAGES_TYPE)) +#define IS_INDICATOR_MESSAGES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_MESSAGES_TYPE)) +#define INDICATOR_MESSAGES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_MESSAGES_TYPE, IndicatorMessagesClass)) + +typedef struct _IndicatorMessages IndicatorMessages; +typedef struct _IndicatorMessagesClass IndicatorMessagesClass; +struct _IndicatorMessagesClass { + IndicatorObjectClass parent_class; +}; + +struct _IndicatorMessages { + IndicatorObject parent; +}; + +GType indicator_messages_get_type (void); + +/* Indicator Module Config */ +INDICATOR_SET_VERSION +INDICATOR_SET_TYPE(INDICATOR_MESSAGES_TYPE) + +/* Globals */ +static GtkWidget * main_image = NULL; #define DESIGN_TEAM_SIZE design_team_size static GtkIconSize design_team_size; - static DBusGProxy * icon_proxy = NULL; - static GtkSizeGroup * indicator_right_group = NULL; +/* Prototypes */ +static void indicator_messages_class_init (IndicatorMessagesClass *klass); +static void indicator_messages_init (IndicatorMessages *self); +static void indicator_messages_dispose (GObject *object); +static void indicator_messages_finalize (GObject *object); +static GtkImage * get_icon (IndicatorObject * io); +static GtkMenu * get_menu (IndicatorObject * io); + +G_DEFINE_TYPE (IndicatorMessages, indicator_messages, INDICATOR_OBJECT_TYPE); + +static void +indicator_messages_class_init (IndicatorMessagesClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->dispose = indicator_messages_dispose; + object_class->finalize = indicator_messages_finalize; + + IndicatorObjectClass * io_class = INDICATOR_OBJECT_CLASS(klass); + + io_class->get_image = get_icon; + io_class->get_menu = get_menu; + + return; +} + +static void +indicator_messages_init (IndicatorMessages *self) +{ +} + +static void +indicator_messages_dispose (GObject *object) +{ +G_OBJECT_CLASS (indicator_messages_parent_class)->dispose (object); +} + +static void +indicator_messages_finalize (GObject *object) +{ +G_OBJECT_CLASS (indicator_messages_parent_class)->finalize (object); +} + + + +/* Functions */ static void attention_changed_cb (DBusGProxy * proxy, gboolean dot, gpointer userdata) { @@ -303,14 +371,8 @@ new_launcher_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusme return TRUE; } -GtkLabel * -get_label (void) -{ - return NULL; -} - -GtkImage * -get_icon (void) +static GtkImage * +get_icon (IndicatorObject * io) { design_team_size = gtk_icon_size_register("design-team-size", 22, 22); @@ -320,8 +382,8 @@ get_icon (void) return GTK_IMAGE(main_image); } -GtkMenu * -get_menu (void) +static GtkMenu * +get_menu (IndicatorObject * io) { guint returnval = 0; GError * error = NULL; -- cgit v1.2.3 From a23bd9f0c82756b6a9c92c94110e2c208d047582 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 5 Nov 2009 21:32:14 -0600 Subject: Disabling static builds because we don't need them, and they seem to cause errors on amd64. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 3edcc3c..729cebe 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,7 @@ AC_PROG_CC AM_PROG_CC_C_O AC_STDC_HEADERS AC_PROG_LIBTOOL +AC_DISABLE_STATIC AC_SUBST(VERSION) AC_CONFIG_MACRO_DIR([m4]) -- cgit v1.2.3 From 2b40fcfa82576f76ba719d0a9321db34c5368cc7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 5 Nov 2009 22:33:59 -0600 Subject: Apparently order matters. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 729cebe..29231a8 100644 --- a/configure.ac +++ b/configure.ac @@ -14,8 +14,8 @@ AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_C_O AC_STDC_HEADERS -AC_PROG_LIBTOOL AC_DISABLE_STATIC +AC_PROG_LIBTOOL AC_SUBST(VERSION) AC_CONFIG_MACRO_DIR([m4]) -- cgit v1.2.3