aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-18 13:44:00 -0500
committerTed Gould <ted@gould.cx>2010-03-18 13:44:00 -0500
commit7bfc56b55562e1bef14708896e062db7925ea5bd (patch)
treeaa4e0da604016035e1b7db5f523a800968e9da10
parent35f3fdb6ee8bf5575bf72f1bbae9b7562a1c236e (diff)
parentbf2af66c70b116d0abd483b82b5a1e43a0dedd5f (diff)
downloadayatana-indicator-messages-7bfc56b55562e1bef14708896e062db7925ea5bd.tar.gz
ayatana-indicator-messages-7bfc56b55562e1bef14708896e062db7925ea5bd.tar.bz2
ayatana-indicator-messages-7bfc56b55562e1bef14708896e062db7925ea5bd.zip
* Upstream release 0.3.4
* Fix avatar spacing to match other menu items * Use standard libindicator icon handling in panel * Fix translation of non-running applications (LP: #540148) * Handling bools for requesting attention from apps * Changing microblogging to broadcast to match Me Menu (LP: #534952)
-rw-r--r--configure.ac4
-rw-r--r--debian/changelog11
-rw-r--r--src/im-menu-item.c21
-rw-r--r--src/indicator-messages.c30
-rw-r--r--src/launcher-menu-item.c2
5 files changed, 46 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index 1427bf0..98fc5a5 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.3.3)
+AM_INIT_AUTOMAKE(indicator-messages, 0.3.4)
AM_MAINTAINER_MODE
@@ -30,7 +30,7 @@ GTK_REQUIRED_VERSION=2.12
GIO_UNIX_REQUIRED_VERSION=2.18
PANEL_REQUIRED_VERSION=2.0.0
INDICATE_REQUIRED_VERSION=0.3.0
-INDICATOR_REQUIRED_VERSION=0.3.3
+INDICATOR_REQUIRED_VERSION=0.3.5
DBUSMENUGTK_REQUIRED_VERSION=0.2.5
PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
diff --git a/debian/changelog b/debian/changelog
index 5bd32af..e35bb4a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+indicator-messages (0.3.4-0ubuntu1~ppa1) UNRELEASED; urgency=low
+
+ * Upstream release 0.3.4
+ * Fix avatar spacing to match other menu items
+ * Use standard libindicator icon handling in panel
+ * Fix translation of non-running applications (LP: #540148)
+ * Handling bools for requesting attention from apps
+ * Changing microblogging to broadcast to match Me Menu (LP: #534952)
+
+ -- Ted Gould <ted@ubuntu.com> Thu, 18 Mar 2010 13:42:42 -0500
+
indicator-messages (0.3.3-0ubuntu2) lucid; urgency=low
* src/default-applications.c
diff --git a/src/im-menu-item.c b/src/im-menu-item.c
index ea9190a..5841d81 100644
--- a/src/im-menu-item.c
+++ b/src/im-menu-item.c
@@ -358,7 +358,7 @@ count_cb (IndicateListener * listener, IndicateListenerServer * server, Indicate
this indicator should be calling for attention or not. If we are,
we need to signal that. */
static void
-attention_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, const gchar * propertydata, gpointer data)
+attention_cb (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * property, const GValue * propertydata, gpointer data)
{
g_debug("Got Attention Information");
ImMenuItem * self = IM_MENU_ITEM(data);
@@ -373,10 +373,19 @@ attention_cb (IndicateListener * listener, IndicateListenerServer * server, Indi
ImMenuItemPrivate * priv = IM_MENU_ITEM_GET_PRIVATE(self);
gboolean wantit;
- if (propertydata == NULL || propertydata[0] == '\0' || !g_strcmp0(propertydata, "false")) {
- wantit = FALSE;
+ if (G_VALUE_HOLDS_BOOLEAN(propertydata)) {
+ wantit = g_value_get_boolean(propertydata);
+ } else if (G_VALUE_HOLDS_STRING(propertydata)) {
+ const gchar * propstring = g_value_get_string(propertydata);
+
+ if (propstring == NULL || propstring[0] == '\0' || !g_strcmp0(propstring, "false")) {
+ wantit = FALSE;
+ } else {
+ wantit = TRUE;
+ }
} else {
- wantit = TRUE;
+ g_warning("Got property '%s' of an unknown type.", property);
+ return;
}
if (priv->attention != wantit) {
@@ -418,7 +427,7 @@ indicator_modified_cb (IndicateListener * listener, IndicateListenerServer * ser
} else if (!g_strcmp0(property, INDICATE_INDICATOR_MESSAGES_PROP_COUNT)) {
indicate_listener_get_property(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_COUNT, count_cb, self);
} else if (!g_strcmp0(property, INDICATE_INDICATOR_MESSAGES_PROP_ATTENTION)) {
- indicate_listener_get_property(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_ATTENTION, attention_cb, self);
+ indicate_listener_get_property_value(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_ATTENTION, attention_cb, self);
} else if (!g_strcmp0(property, "sender")) {
/* This is a compatibility string with v1 and should be removed */
g_debug("Indicator is using 'sender' property which is a v1 string.");
@@ -451,7 +460,7 @@ im_menu_item_new (IndicateListener * listener, IndicateListenerServer * server,
indicate_listener_get_property_time(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_TIME, time_cb, self);
indicate_listener_get_property(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_ICON, icon_cb, self);
indicate_listener_get_property(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_COUNT, count_cb, self);
- indicate_listener_get_property(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_ATTENTION, attention_cb, self);
+ indicate_listener_get_property_value(listener, server, indicator, INDICATE_INDICATOR_MESSAGES_PROP_ATTENTION, attention_cb, self);
indicate_listener_get_property(listener, server, indicator, "sender", sender_cb, self);
g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL);
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index 3f533a5..f6b2084 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -31,6 +31,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libindicator/indicator.h>
#include <libindicator/indicator-object.h>
+#include <libindicator/indicator-image-helper.h>
#include "dbus-data.h"
#include "messages-service-client.h"
@@ -61,8 +62,6 @@ 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;
@@ -116,9 +115,9 @@ static void
attention_changed_cb (DBusGProxy * proxy, gboolean dot, gpointer userdata)
{
if (dot) {
- gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages-new", DESIGN_TEAM_SIZE);
+ indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages-new");
} else {
- gtk_image_set_from_icon_name(GTK_IMAGE(main_image), "indicator-messages", DESIGN_TEAM_SIZE);
+ indicator_image_helper_update(GTK_IMAGE(main_image), "indicator-messages");
}
return;
}
@@ -278,17 +277,24 @@ new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm
GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_menu_item_new());
- GtkWidget * hbox = gtk_hbox_new(FALSE, 4);
+ gint padding = 4;
+ gtk_widget_style_get(GTK_WIDGET(gmi), "horizontal-padding", &padding, NULL);
+
+ GtkWidget * hbox = gtk_hbox_new(FALSE, 0);
/* Icon, probably someone's face or avatar on an IM */
mi_data->icon = gtk_image_new();
+
+ /* Set the minimum size, we always want it to take space */
+ gint width, height;
+ gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
+ gtk_widget_set_size_request(mi_data->icon, width, height);
+
GdkPixbuf * pixbuf = dbusmenu_menuitem_property_get_image(newitem, INDICATOR_MENUITEM_PROP_ICON);
if (pixbuf != NULL) {
/* 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);
@@ -309,13 +315,13 @@ new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm
}
}
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);
+ gtk_box_pack_start(GTK_BOX(hbox), mi_data->icon, FALSE, FALSE, padding);
gtk_widget_show(mi_data->icon);
/* Label, probably a username, chat room or mailbox name */
mi_data->label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, INDICATOR_MENUITEM_PROP_LABEL));
gtk_misc_set_alignment(GTK_MISC(mi_data->label), 0.0, 0.5);
- gtk_box_pack_start(GTK_BOX(hbox), mi_data->label, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), mi_data->label, TRUE, TRUE, padding);
gtk_widget_show(mi_data->label);
/* Usually either the time or the count on the individual
@@ -323,7 +329,7 @@ new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm
mi_data->right = gtk_label_new(dbusmenu_menuitem_property_get(newitem, INDICATOR_MENUITEM_PROP_RIGHT));
gtk_size_group_add_widget(indicator_right_group, mi_data->right);
gtk_misc_set_alignment(GTK_MISC(mi_data->right), 1.0, 0.5);
- gtk_box_pack_start(GTK_BOX(hbox), mi_data->right, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), mi_data->right, FALSE, FALSE, padding);
gtk_widget_show(mi_data->right);
gtk_container_add(GTK_CONTAINER(gmi), hbox);
@@ -340,9 +346,7 @@ new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm
static GtkImage *
get_icon (IndicatorObject * io)
{
- design_team_size = gtk_icon_size_register("design-team-size", 22, 22);
-
- main_image = gtk_image_new_from_icon_name("indicator-messages", DESIGN_TEAM_SIZE);
+ main_image = GTK_WIDGET(indicator_image_helper("indicator-messages"));
gtk_widget_show(main_image);
return GTK_IMAGE(main_image);
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c
index f70f28b..279d167 100644
--- a/src/launcher-menu-item.c
+++ b/src/launcher-menu-item.c
@@ -167,7 +167,7 @@ launcher_menu_item_new (const gchar * desktop_file)
if (default_name == NULL) {
dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, launcher_menu_item_get_name(self));
} else {
- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, default_name);
+ dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_LABEL, _(default_name));
}
gchar * iconstr;