~ubuntu-branches/ubuntu/maverick/empathy/maverick-proposed-201101251021

« back to all changes in this revision

Viewing changes to src/empathy-chat-window.c

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2010-04-09 15:07:58 UTC
  • mfrom: (1.1.52 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409150758-dzc1z2r690p28ort
Tags: 2.30.0.1-0ubuntu1
* New upstream version 
  - empathy crashed with SIGSEGV in g_closure_invoke() (LP: #527296)
  - contact list is empty for a jabber account with a lot of 
    contacts (LP: #539023)
  - Join room should be greyed out for AIM (LP: #540525)
  - Previous/Next Tab menu items aren't disabled if at the first/last tab 
    and gtk-keynav-wrap-around is 0
  - empathy incorrectly updates our own IRC nick for /me
  - Shouldn't request RoomList channel if not supported by connection
  - account-chooser crashes when setting a filter and has-all-option to TRUE
  - empathy crashed with SIGSEGV in g_object_unref() (LP: #556977)
  - Wrong account name when using the assistant 
  - Empathy fails to initiate a audio/video call over XMPP
* debian/patches/20_libindicate.patch
  - Ported patch to remove NotificationData, removed upstream
* debian/patches/32_append_notifications.patch
  - Ported patch to remove NotificationData, removed upstream
* debian/patches/21_login_indicators.patch
  - Only display indicator for signon events if the preference 
    is set (LP: #533857)

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
#define DEBUG_FLAG EMPATHY_DEBUG_CHAT
62
62
#include <libempathy/empathy-debug.h>
63
63
 
64
 
typedef struct {
65
 
        EmpathyChatWindow *window;
66
 
        EmpathyChat *chat;
67
 
} NotificationData;
68
 
 
69
64
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyChatWindow)
70
65
typedef struct {
71
66
        EmpathyChat *current_chat;
79
74
        GtkWidget   *dialog;
80
75
        GtkWidget   *notebook;
81
76
        NotifyNotification *notification;
82
 
        NotificationData *notification_data;
83
77
 
84
78
        GtkTargetList *contact_targets;
85
79
        GtkTargetList *file_targets;
333
327
{
334
328
        gboolean first_page;
335
329
        gboolean last_page;
 
330
        gboolean wrap_around;
336
331
        gboolean is_connected;
337
332
        gint     page_num;
338
333
 
339
334
        page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
340
335
        first_page = (page_num == 0);
341
336
        last_page = (page_num == (num_pages - 1));
 
337
        g_object_get (gtk_settings_get_default (), "gtk-keynav-wrap-around",
 
338
                      &wrap_around, NULL);
342
339
        is_connected = empathy_chat_get_tp_chat (priv->current_chat) != NULL;
343
340
 
344
 
        gtk_action_set_sensitive (priv->menu_tabs_next, TRUE);
345
 
        gtk_action_set_sensitive (priv->menu_tabs_prev, TRUE);
 
341
        gtk_action_set_sensitive (priv->menu_tabs_next, (!last_page ||
 
342
                                                         wrap_around));
 
343
        gtk_action_set_sensitive (priv->menu_tabs_prev, (!first_page ||
 
344
                                                         wrap_around));
346
345
        gtk_action_set_sensitive (priv->menu_tabs_detach, num_pages > 1);
347
346
        gtk_action_set_sensitive (priv->menu_tabs_left, !first_page);
348
347
        gtk_action_set_sensitive (priv->menu_tabs_right, !last_page);
1184
1183
}
1185
1184
 
1186
1185
static void
1187
 
free_notification_data (NotificationData *data)
1188
 
{
1189
 
        g_object_unref (data->chat);
1190
 
        g_slice_free (NotificationData, data);
1191
 
}
1192
 
 
1193
 
static void
1194
1186
chat_window_notification_closed_cb (NotifyNotification *notify,
1195
 
                                    NotificationData *cb_data)
 
1187
                                    EmpathyChatWindow *self)
1196
1188
{
1197
 
        EmpathyNotificationClosedReason reason = 0;
1198
 
        EmpathyChatWindowPriv *priv = GET_PRIV (cb_data->window);
1199
 
 
1200
 
#ifdef notify_notification_get_closed_reason
1201
 
        reason = notify_notification_get_closed_reason (notify);
1202
 
#endif
1203
 
        if (reason == EMPATHY_NOTIFICATION_CLOSED_DISMISSED) {
1204
 
                empathy_chat_window_present_chat (cb_data->chat);
1205
 
        }
 
1189
        EmpathyChatWindowPriv *priv = GET_PRIV (self);
1206
1190
 
1207
1191
        g_object_unref (notify);
1208
1192
        priv->notification = NULL;
1209
 
        free_notification_data (cb_data);
1210
 
        priv->notification_data = NULL;
1211
1193
}
1212
1194
 
1213
1195
static void
1242
1224
                notify_notification_update (priv->notification,
1243
1225
                                            header, escaped, NULL);
1244
1226
        } else {
1245
 
                NotificationData *cb_data = cb_data = g_slice_new0 (NotificationData);
1246
 
 
1247
 
                cb_data->chat = g_object_ref (chat);
1248
 
                cb_data->window = window;
1249
 
 
1250
 
                priv->notification_data = cb_data;
1251
1227
                priv->notification = notify_notification_new (header, escaped, NULL, NULL);
1252
1228
                notify_notification_set_timeout (priv->notification, NOTIFY_EXPIRES_DEFAULT);
1253
1229
 
1254
1230
                g_signal_connect (priv->notification, "closed",
1255
 
                                  G_CALLBACK (chat_window_notification_closed_cb), cb_data);
 
1231
                                  G_CALLBACK (chat_window_notification_closed_cb), window);
1256
1232
        }
1257
1233
 
1258
1234
        pixbuf = empathy_notify_manager_get_pixbuf_for_notification (priv->notify_mgr,
1757
1733
                notify_notification_close (priv->notification, NULL);
1758
1734
                g_object_unref (priv->notification);
1759
1735
                priv->notification = NULL;
1760
 
                if (priv->notification_data != NULL)
1761
 
                        {
1762
 
                                free_notification_data (priv->notification_data);
1763
 
                                priv->notification_data = NULL;
1764
 
                        }
1765
1736
        }
1766
1737
 
1767
1738
        if (priv->contact_targets) {