From fe35fc4c2c9ea545ba1086781b3f07d48d60fc46 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:02:48 -0500 Subject: Setting up the gettext stuff. --- src/messages-service.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/messages-service.c b/src/messages-service.c index 0ba0deb..4911124 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -22,6 +22,7 @@ with this program. If not, see . #include #include +#include #include #include #include @@ -1220,7 +1221,11 @@ main (int argc, char ** argv) return 1; } - setlocale(LC_ALL,""); + /* Setting up i18n and gettext. Apparently, we need + all of these. */ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain (GETTEXT_PACKAGE); dbus_interface = message_service_dbus_new(); -- cgit v1.2.3 From a1c5c2a79818b456532e568cb94473e734ca80c3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:02:58 -0500 Subject: Adding a po directory with a list of files. --- po/POTFILES.in | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 po/POTFILES.in diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..0e37af8 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,6 @@ +src/messages-service-dbus.c +src/indicator-messages.c +src/messages-service.c +src/launcher-menu-item.c +src/im-menu-item.c +src/app-menu-item.c -- cgit v1.2.3 From a96ee29bd978743128d743d5baedc2e9365f0b25 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:04:34 -0500 Subject: Adding configure stuff in to set up gettext --- configure.ac | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/configure.ac b/configure.ac index 174aec6..2470482 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,33 @@ else fi AC_SUBST(DBUSSERVICEDIR) +############################## +# Custom Junk +############################## + +AC_DEFUN([AC_DEFINE_PATH], [ + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + ac_define_path=`eval echo [$]$2` + ac_define_path=`eval echo [$]ac_define_path` + $1="$ac_define_path" + AC_SUBST($1) + ifelse($3, , + AC_DEFINE_UNQUOTED($1, "$ac_define_path"), + AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3)) +]) + +########################### +# Internationalization +########################### + +GETTEXT_PACKAGE=indicator-session +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain]) +AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory]) + +AM_GLIB_GNU_GETTEXT + ########################### # Files ########################### -- cgit v1.2.3 From edd1898503d99afa6bec65b8ae03dff9554f4ac6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:06:55 -0500 Subject: Making it so the po directory is connected in. --- Makefile.am | 3 ++- configure.ac | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 7d58c6b..26c2a33 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,8 @@ SUBDIRS = \ src \ - data + data \ + po DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall diff --git a/configure.ac b/configure.ac index 2470482..f9f4fe3 100644 --- a/configure.ac +++ b/configure.ac @@ -115,6 +115,7 @@ data/icons/48x48/Makefile data/icons/48x48/status/Makefile data/icons/scalable/Makefile data/icons/scalable/status/Makefile +po/Makefile.in ]) ########################### -- cgit v1.2.3 From 17df48a68405b137f9245919e18fa0f8132e3a56 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:11:15 -0500 Subject: Oops, teach me to cut and paste :) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f9f4fe3..ce3e9e9 100644 --- a/configure.ac +++ b/configure.ac @@ -87,7 +87,7 @@ AC_DEFUN([AC_DEFINE_PATH], [ # Internationalization ########################### -GETTEXT_PACKAGE=indicator-session +GETTEXT_PACKAGE=indicator-messages AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain]) AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory]) -- cgit v1.2.3 From b196e9b6ec66689cdfe4ed1163f5ef5b32302f0c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:13:51 -0500 Subject: Adding in some encoding to make things fun. --- po/POTFILES.in | 1 + 1 file changed, 1 insertion(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 0e37af8..0d88e74 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,3 +1,4 @@ +[encoding: UTF-8] src/messages-service-dbus.c src/indicator-messages.c src/messages-service.c -- cgit v1.2.3 From 20dddacbcac7e047a9165782318a72c4bb4cab31 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:17:44 -0500 Subject: Adding in header for gettext --- src/messages-service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/messages-service.c b/src/messages-service.c index 4911124..e37a721 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -22,6 +22,7 @@ with this program. If not, see . #include #include +#include #include #include #include -- cgit v1.2.3 From 62a047790465aaee453f1cb1cbd9042762f0486b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 16:32:42 -0500 Subject: Forgot intltool --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index ce3e9e9..ee44f91 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,8 @@ AM_INIT_AUTOMAKE(indicator-messages, 0.2.2) AM_MAINTAINER_MODE +IT_PROG_INTLTOOL([0.35.0]) + AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_C_O -- cgit v1.2.3 From 40a0102f12f2c355d32394a8480fe953726b65c9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 17 Sep 2009 09:58:02 -0500 Subject: Making a purdy 0.2.3 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ee44f91..7c83506 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-messages.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-messages, 0.2.2) +AM_INIT_AUTOMAKE(indicator-messages, 0.2.3) AM_MAINTAINER_MODE -- cgit v1.2.3 From fdc70a0ddecdf91071f6eed1e7d891050ff90446 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 11:06:01 -0500 Subject: Changing directory names --- src/dirs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dirs.h b/src/dirs.h index a994ff5..ca322f0 100644 --- a/src/dirs.h +++ b/src/dirs.h @@ -1,3 +1,4 @@ -#define SYSTEM_APPS_DIR "/etc/indicators/messages/applications" +#define SYSTEM_APPS_DIR "/usr/share/indicators/messages/applications" +#define SYSTEM_APPS_DIR_OLD "/etc/indicators/messages/applications" #define USER_APPS_DIR "indicators/messages/applications" #define USER_BLACKLIST_DIR "indicators/messages/applications-blacklist" -- cgit v1.2.3 From 4f1a8334b9f819d24dfed202ef6c7d6da272848d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 11:11:52 -0500 Subject: Looking at the old system apps directory as well. --- src/messages-service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/messages-service.c b/src/messages-service.c index e37a721..1a2fa82 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -1244,6 +1244,7 @@ main (int argc, char ** argv) g_idle_add(blacklist_init, NULL); g_idle_add(build_launchers, SYSTEM_APPS_DIR); + g_idle_add(build_launchers, SYSTEM_APPS_DIR_OLD); gchar * userdir = g_build_filename(g_get_user_config_dir(), USER_APPS_DIR, NULL); g_idle_add(build_launchers, userdir); -- cgit v1.2.3 From eddfb1cec5a4a6d5b8674c102a72edbb9fcf37ec Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 11:48:09 -0500 Subject: If we're not given a valid desktop file we should eclipse ourselves, and if we're eclipsed, we should hide the separator as well. --- src/launcher-menu-item.c | 4 ++++ src/messages-service.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c index 822196b..5afe7a9 100644 --- a/src/launcher-menu-item.c +++ b/src/launcher-menu-item.c @@ -137,6 +137,10 @@ launcher_menu_item_new (const gchar * desktop_file) g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL); + if (priv->appinfo == NULL) { + launcher_menu_item_set_eclipsed(self, TRUE); + } + return self; } diff --git a/src/messages-service.c b/src/messages-service.c index 1a2fa82..1272355 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -1148,7 +1148,10 @@ build_launcher (gpointer data) dbusmenu_menuitem_child_append(root_menuitem, DBUSMENU_MENUITEM(ll->separator)); resort_menu(root_menuitem); - if (blacklist_check(launcher_menu_item_get_desktop(ll->menuitem))) { + /* If we're in the black list or we've gotten eclipsed + by something else, hide the item and the separator. */ + if (blacklist_check(launcher_menu_item_get_desktop(ll->menuitem)) || + launcher_menu_item_get_eclipsed(ll->menuitem)) { launcher_menu_item_set_eclipsed(ll->menuitem, TRUE); dbusmenu_menuitem_property_set(ll->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, "false"); } -- cgit v1.2.3 From 5a40fa084024e174cd1e76781102d1c366a13d0a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 12:51:34 -0500 Subject: Putting in a little code to scale icons. --- src/indicator-messages.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/indicator-messages.c b/src/indicator-messages.c index a3f22aa..070b2be 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -194,7 +194,27 @@ new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm mi_data->icon = gtk_image_new(); GdkPixbuf * pixbuf = dbusmenu_menuitem_property_get_image(newitem, INDICATOR_MENUITEM_PROP_ICON); if (pixbuf != NULL) { - gtk_image_set_from_pixbuf(GTK_IMAGE(mi_data->icon), pixbuf); + /* If we've got a pixbuf we need to make sure it's of a reasonable + size to fit in the menu. If not, rescale it. */ + GdkPixbuf * resized_pixbuf; + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + if (gdk_pixbuf_get_width(pixbuf) > width || + gdk_pixbuf_get_height(pixbuf) > height) { + resized_pixbuf = gdk_pixbuf_scale_simple(pixbuf, + width, + height, + GDK_INTERP_BILINEAR); + } else { + resized_pixbuf = pixbuf; + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(mi_data->icon), resized_pixbuf); + + /* The other pixbuf should be free'd by the dbusmenu. */ + if (resized_pixbuf != pixbuf) { + g_object_unref(resized_pixbuf); + } } gtk_misc_set_alignment(GTK_MISC(mi_data->icon), 0.0, 0.5); gtk_box_pack_start(GTK_BOX(hbox), mi_data->icon, FALSE, FALSE, 0); -- cgit v1.2.3 From fcda1c20e3ebfa62d3696a493af3ef3ef4716402 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 13:22:08 -0500 Subject: Forgot to scale on icon changing. --- src/indicator-messages.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/indicator-messages.c b/src/indicator-messages.c index 070b2be..01f2579 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -164,7 +164,29 @@ indicator_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, gchar * value, in is already cached, shouldn't be a big deal really. */ GdkPixbuf * pixbuf = dbusmenu_menuitem_property_get_image(mi, INDICATOR_MENUITEM_PROP_ICON); if (pixbuf != NULL) { - gtk_image_set_from_pixbuf(GTK_IMAGE(mi_data->icon), pixbuf); + /* If we've got a pixbuf we need to make sure it's of a reasonable + size to fit in the menu. If not, rescale it. */ + GdkPixbuf * resized_pixbuf; + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + if (gdk_pixbuf_get_width(pixbuf) > width || + gdk_pixbuf_get_height(pixbuf) > height) { + g_debug("Resizing icon from %dx%d to %dx%d", gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf), width, height); + resized_pixbuf = gdk_pixbuf_scale_simple(pixbuf, + width, + height, + GDK_INTERP_BILINEAR); + } else { + g_debug("Happy with icon sized %dx%d", gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf)); + resized_pixbuf = pixbuf; + } + + gtk_image_set_from_pixbuf(GTK_IMAGE(mi_data->icon), resized_pixbuf); + + /* The other pixbuf should be free'd by the dbusmenu. */ + if (resized_pixbuf != pixbuf) { + g_object_unref(resized_pixbuf); + } } } else { g_warning("Indicator Item property '%s' unknown", prop); @@ -201,11 +223,13 @@ new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); if (gdk_pixbuf_get_width(pixbuf) > width || gdk_pixbuf_get_height(pixbuf) > height) { + g_debug("Resizing icon from %dx%d to %dx%d", gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf), width, height); resized_pixbuf = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); } else { + g_debug("Happy with icon sized %dx%d", gdk_pixbuf_get_width(pixbuf), gdk_pixbuf_get_height(pixbuf)); resized_pixbuf = pixbuf; } -- cgit v1.2.3 -- cgit v1.2.3 From a8ccb31fbb4a2c7a6bba2b19933ffad754e7f910 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 15:49:37 -0500 Subject: Putting in teh size request a minimum width --- src/indicator-messages.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/indicator-messages.c b/src/indicator-messages.c index a3f22aa..e180992 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -241,6 +241,7 @@ new_launcher_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusme GtkWidget * dsc_label = gtk_label_new(""); gtk_misc_set_alignment(GTK_MISC(dsc_label), 0.05, 0.5); gtk_label_set_ellipsize(GTK_LABEL(dsc_label), PANGO_ELLIPSIZE_END); + gtk_widget_set_size_request(dsc_label, 250, -1); gchar * markup = g_markup_printf_escaped("%s", dbusmenu_menuitem_property_get(newitem, LAUNCHER_MENUITEM_PROP_APP_DESC)); gtk_label_set_markup(GTK_LABEL(dsc_label), markup); g_free(markup); -- cgit v1.2.3 From 3d2040f341e56d9de99fa9a2dd35c1fa4821eafc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 15:58:34 -0500 Subject: Too big --- src/indicator-messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/indicator-messages.c b/src/indicator-messages.c index e180992..c86389c 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -241,7 +241,7 @@ new_launcher_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusme GtkWidget * dsc_label = gtk_label_new(""); gtk_misc_set_alignment(GTK_MISC(dsc_label), 0.05, 0.5); gtk_label_set_ellipsize(GTK_LABEL(dsc_label), PANGO_ELLIPSIZE_END); - gtk_widget_set_size_request(dsc_label, 250, -1); + gtk_widget_set_size_request(dsc_label, 200, -1); gchar * markup = g_markup_printf_escaped("%s", dbusmenu_menuitem_property_get(newitem, LAUNCHER_MENUITEM_PROP_APP_DESC)); gtk_label_set_markup(GTK_LABEL(dsc_label), markup); g_free(markup); -- cgit v1.2.3 From 4a804cf6f217547cf67ce432404f5809bc2357a3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 23 Sep 2009 16:05:02 -0500 Subject: Adding in a resort after editing the blacklist --- src/messages-service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/messages-service.c b/src/messages-service.c index 1272355..65c9af7 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -350,6 +350,7 @@ blacklist_remove (gpointer data) } check_hidden(); + resort_menu(root_menuitem); return FALSE; } -- cgit v1.2.3 From 6dc6c07815ec4034e8a62ced7b3638c476ce78f8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 24 Sep 2009 13:04:30 -0500 Subject: Making a 0.2.4 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7c83506..1c67c9e 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-messages.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-messages, 0.2.3) +AM_INIT_AUTOMAKE(indicator-messages, 0.2.4) AM_MAINTAINER_MODE -- cgit v1.2.3