]> git.0d.be Git - empathy.git/commitdiff
Tooltip for subscription request shouldn't display "Message:" if the
authorXavier Claessens <xclaesse@gmail.com>
Fri, 21 Sep 2007 13:19:33 +0000 (13:19 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 21 Sep 2007 13:19:33 +0000 (13:19 +0000)
2007-09-21  Xavier Claessens  <xclaesse@gmail.com>

* libempathy-gtk/empathy-status-icon.c: Tooltip for subscription request
shouldn't display "Message:" if the message is empty. Fixes bug #459538
(Cosimo Cecchi).
Do not update tooltip each time the icon change.

svn path=/trunk/; revision=306

ChangeLog
libempathy-gtk/empathy-status-icon.c

index 3b91ca5a9ca39b5ba4e9dd681059ea79cf521ca0..53e764d4950ea25cfc774b8587398503e394d9f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-09-21  Xavier Claessens  <xclaesse@gmail.com>
+
+       * libempathy-gtk/empathy-status-icon.c: Tooltip for subscription request
+       shouldn't display "Message:" if the message is empty. Fixes bug #459538
+       (Cosimo Cecchi).
+       Do not update tooltip each time the icon change.
+
 2007-09-21  Xavier Claessens  <xclaesse@gmail.com>
 
        * libempathy-gtk/empathy-chat-window.c: Do not set "new message" in
index 4fc1ca055c92fe692642d75b19b56415d61f1265..39c4bcfe6d8fc2b05005542dc9d0f060ba9ca926 100644 (file)
@@ -552,7 +552,7 @@ status_icon_pendings_changed_cb (EmpathyContactManager *manager,
 {
        EmpathyStatusIconPriv *priv;
        StatusIconEvent       *event;
-       gchar                 *str;
+       GString               *str;
        GList                 *l;
 
        priv = GET_PRIV (icon);
@@ -568,16 +568,18 @@ status_icon_pendings_changed_cb (EmpathyContactManager *manager,
                }
        }
 
-       str = g_strdup_printf (_("Subscription requested for %s\n"
-                                "Message: %s"),
-                              empathy_contact_get_name (contact),
-                              message);
+       str = g_string_new (NULL);
+       g_string_printf (str, _("Subscription requested by %s"),
+                        empathy_contact_get_name (contact));   
+       if (!G_STR_EMPTY (message)) {
+               g_string_append_printf (str, _("\nMessage: %s"), message);
+       }
 
-       event = status_icon_event_new (icon, GTK_STOCK_DIALOG_QUESTION, str);
+       event = status_icon_event_new (icon, GTK_STOCK_DIALOG_QUESTION, str->str);
        event->user_data = g_object_ref (contact);
        event->func = status_icon_event_subscribe_cb;
 
-       g_free (str);
+       g_string_free (str, TRUE);
 }
 
 static void
@@ -639,6 +641,7 @@ status_icon_event_new (EmpathyStatusIcon *icon,
                                                     (GSourceFunc) status_icon_event_timeout_cb,
                                                     icon);
                status_icon_event_timeout_cb (icon);
+               status_icon_update_tooltip (icon);
        }
 
        return event;
@@ -688,7 +691,6 @@ status_icon_event_timeout_cb (EmpathyStatusIcon *icon)
                event = priv->events->data;
                gtk_status_icon_set_from_icon_name (priv->icon, event->icon_name);
        }
-       status_icon_update_tooltip (icon);
 
        return TRUE;
 }