aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog6
-rw-r--r--src/indicator-sus.c2
-rw-r--r--src/status-service-dbus.c32
3 files changed, 36 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index 7a1738a..a7434b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+indicator-sus (0.1~ppa7~status5) UNRELEASED; urgency=low
+
+ * Trying to do some more icon fixes.
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 12 Aug 2009 21:48:21 -0600
+
indicator-sus (0.1~ppa7~status4) karmic; urgency=low
* Clean up build a little bit
diff --git a/src/indicator-sus.c b/src/indicator-sus.c
index be83c29..fcab5cb 100644
--- a/src/indicator-sus.c
+++ b/src/indicator-sus.c
@@ -73,6 +73,7 @@ get_label (void)
GtkImage *
get_icon (void)
{
+ g_debug("Changing status icon: %s", "user-offline");
status_image = GTK_IMAGE(gtk_image_new_from_icon_name("user-offline", GTK_ICON_SIZE_MENU));
gtk_widget_show(GTK_WIDGET(status_image));
return status_image;
@@ -188,6 +189,7 @@ status_icon_cb (DBusGProxy * proxy, char * icons, GError *error, gpointer userda
g_return_if_fail(icons != NULL);
g_return_if_fail(icons[0] == '\0');
+ g_debug("Changing status icon: %s", icons);
gtk_image_set_from_icon_name(status_image, icons, GTK_ICON_SIZE_MENU);
return;
diff --git a/src/status-service-dbus.c b/src/status-service-dbus.c
index 09d2711..65de499 100644
--- a/src/status-service-dbus.c
+++ b/src/status-service-dbus.c
@@ -34,7 +34,7 @@ static void status_service_dbus_init (StatusServiceDbus *self);
static void status_service_dbus_dispose (GObject *object);
static void status_service_dbus_finalize (GObject *object);
static gboolean _status_service_server_watch (StatusServiceDbus * service, GError ** error);
-static gboolean _status_service_server_status_icons (StatusServiceDbus * service, GArray * array, GError ** error);
+static gboolean _status_service_server_status_icons (StatusServiceDbus * service, gchar ** icon, GError ** error);
static gboolean _status_service_server_pretty_user_name (StatusServiceDbus * service, gchar ** username, GError ** error);
#include "status-service-server.h"
@@ -44,6 +44,7 @@ typedef struct _StatusServiceDbusPrivate StatusServiceDbusPrivate;
struct _StatusServiceDbusPrivate
{
gchar * name;
+ gchar * icon;
};
#define STATUS_SERVICE_DBUS_GET_PRIVATE(o) \
@@ -120,7 +121,8 @@ status_service_dbus_init (StatusServiceDbus *self)
G_OBJECT(self));
StatusServiceDbusPrivate * priv = STATUS_SERVICE_DBUS_GET_PRIVATE(self);
- priv->name = "test";
+ priv->name = NULL;
+ priv->icon = NULL;
return;
}
@@ -149,8 +151,19 @@ _status_service_server_watch (StatusServiceDbus * service, GError ** error)
}
static gboolean
-_status_service_server_status_icons (StatusServiceDbus * service, GArray * array, GError ** error)
+_status_service_server_status_icons (StatusServiceDbus * service, gchar ** icon, GError ** error)
{
+ if (!IS_STATUS_SERVICE_DBUS(service)) {
+ g_warning("NO BAD EVIL!");
+ return FALSE;
+ }
+
+ StatusServiceDbusPrivate * priv = STATUS_SERVICE_DBUS_GET_PRIVATE(service);
+ if (priv->icon == NULL) {
+ *icon = g_strdup("");
+ } else {
+ *icon = g_strdup(priv->icon);
+ }
return TRUE;
}
@@ -176,6 +189,17 @@ _status_service_server_pretty_user_name (StatusServiceDbus * service, gchar ** u
void
status_service_dbus_set_status (StatusServiceDbus * self, const gchar * icon)
{
- g_signal_emit(G_OBJECT(self), signals[STATUS_ICONS_CHANGED], 0, icon, TRUE);
+ g_return_if_fail(IS_STATUS_SERVICE_DBUS(self));
+
+ g_debug("Setting icon to: %s", icon);
+
+ StatusServiceDbusPrivate * priv = STATUS_SERVICE_DBUS_GET_PRIVATE(self);
+
+ if (priv->icon != NULL) {
+ g_free(priv->icon);
+ }
+ priv->icon = g_strdup(icon);
+
+ g_signal_emit(G_OBJECT(self), signals[STATUS_ICONS_CHANGED], 0, priv->icon, TRUE);
return;
}