]> git.0d.be Git - empathy.git/blobdiff - src/empathy-status-icon.c
Escape to cancel from status editing
[empathy.git] / src / empathy-status-icon.c
index f6496003e3f5bc74a9f4ae6a3589d5ceb7a752e5..6c0ddb2502b39b0b43b6dac6e9ee9688740348d5 100644 (file)
@@ -84,7 +84,7 @@ status_icon_notification_closed_cb (NotifyNotification *notification,
                                    EmpathyStatusIcon  *icon)
 {
        EmpathyStatusIconPriv *priv = GET_PRIV (icon);
-       int reason = 1;
+       EmpathyNotificationClosedReason reason = 0;
 
 #ifdef notify_notification_get_closed_reason
        reason = notify_notification_get_closed_reason (notification);
@@ -101,7 +101,7 @@ status_icon_notification_closed_cb (NotifyNotification *notification,
        /* the notification has been closed by the user, see the
         * DesktopNotification spec.
         */
-       if (reason == NOTIFICATION_CLOSED_DISMISSED) {
+       if (reason == EMPATHY_NOTIFICATION_CLOSED_DISMISSED) {
                /* use an idle here, as this callback is called from a
                 * DBus signal handler inside libnotify, and we might call
                 * a *_run_* method when activating the event.
@@ -170,20 +170,19 @@ status_icon_update_tooltip (EmpathyStatusIcon *icon)
        gchar                 *tooltip = NULL;
 
        if (priv->event) {
-               tooltip = g_strdup_printf ("%s\n%s",
-                                          priv->event->header,
-                                          priv->event->message);
-       }
-
-       if (!tooltip) {
+               if (priv->event->message != NULL)
+                               tooltip = g_strdup_printf ("<i>%s</i>\n%s",
+                                                          priv->event->header,
+                                                          priv->event->message);
+               else
+                               tooltip = g_strdup_printf ("<i>%s</i>",
+                                                          priv->event->header);
+               gtk_status_icon_set_tooltip_markup (priv->icon, tooltip);
+       } else {
                tooltip = g_strdup (empathy_idle_get_status (priv->idle));
+               gtk_status_icon_set_tooltip_text (priv->icon, tooltip);
        }
 
-       /* FIXME: when we will depend on GTK+ 2.16.0, we should use
-        * gtk_status_icon_set_tooltip_markup () and make the header italic.
-        */
-       gtk_status_icon_set_tooltip (priv->icon, tooltip);
-
        g_free (tooltip);
 }
 
@@ -590,7 +589,7 @@ empathy_status_icon_new (GtkWindow *window, gboolean hide_contact_list)
 
        priv->window = g_object_ref (window);
 
-       g_signal_connect (priv->window, "key-press-event",
+       g_signal_connect_after (priv->window, "key-press-event",
                          G_CALLBACK (status_icon_key_press_event_cb),
                          icon);