~ubuntu-branches/ubuntu/utopic/gossip/utopic

« back to all changes in this revision

Viewing changes to src/gossip-notify.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-09-25 07:49:52 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20060925074952-blrr03kralywuvi2
Tags: 0.17-0ubuntu1
* New upstream release:
  - Require GTK+ 2.10
  - Show the contacts in a flat type mode instead of tree like so we don't 
    waste space on the left
  - Fixed "Handle vcard presence error: 503"
  - Fixed "Crasher: Disconnect the error handler in the accounts dialog"
  - Fixed "Focus is broken for new chat windows"
  - Fixed "Gossip confused by my vcard"
  - Fixed "Gossip doesn't reread proxy settings when connecting"
  - Fixed "Deprecate EggTrayIcon in favour of GtkStatusIcon"
  - Fixed "Personal Information window displayed no avatar picture"
  - Fixed "Rework GossipAccount to support variable parameters per protocol"
  - Fixed "New roster view has no collapse/expand triangle"
  - Translations:
    - Updated nl, sv.
* debian/control.in:
  - bumped glib, gtk and notify requirements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        NOTIFY_SHOW_ROSTER
92
92
};
93
93
 
94
 
static gboolean    inited = FALSE;
95
 
static GHashTable *account_states = NULL;
96
 
static GHashTable *contact_states = NULL;
97
 
static GHashTable *message_notifications = NULL;
98
 
static GHashTable *event_notifications = NULL;
99
 
static GtkWidget  *attach_widget = NULL;
 
94
static gboolean       inited = FALSE;
 
95
static GHashTable    *account_states = NULL;
 
96
static GHashTable    *contact_states = NULL;
 
97
static GHashTable    *message_notifications = NULL;
 
98
static GHashTable    *event_notifications = NULL;
 
99
static GtkWidget     *attach_widget = NULL;
 
100
static GtkStatusIcon *attach_status_icon = NULL;
100
101
 
101
102
static const gchar *
102
103
notify_get_status_from_presence (GossipPresence *presence)
212
213
                          G_CALLBACK (notify_closed_cb),
213
214
                          NULL);
214
215
 
215
 
        if (attach_widget) {
216
 
                notify_notification_attach_to_widget (notify, attach_widget);
 
216
        if (attach_status_icon) {
 
217
                notify_notification_attach_to_status_icon (notify, attach_status_icon);
217
218
        }
218
219
 
219
220
        notify_notification_add_action (notify, "default", _("Default"),
278
279
        notify = notify_notification_new (_("Subscription request"),
279
280
                                          message,
280
281
                                          NULL,
281
 
                                          attach_widget);
 
282
                                          NULL);
282
283
        g_free (message);
283
284
 
284
285
        notify_notification_set_urgency (notify, NOTIFY_URGENCY_NORMAL);
429
430
                          G_CALLBACK (notify_closed_cb),
430
431
                          NULL);
431
432
 
432
 
        if (attach_widget) {
433
 
                notify_notification_attach_to_widget (notify, attach_widget);
 
433
        if (attach_status_icon) {
 
434
                notify_notification_attach_to_status_icon (notify, attach_status_icon);
434
435
        }
435
436
        
436
437
        notify_notification_add_action (notify, "default", _("Default"),
686
687
        }
687
688
}
688
689
 
 
690
void
 
691
gossip_notify_set_attach_status_icon (GtkStatusIcon *new_attach)
 
692
{
 
693
        if (attach_status_icon) {
 
694
                g_object_remove_weak_pointer (G_OBJECT (attach_status_icon),
 
695
                                              (gpointer) &attach_status_icon);
 
696
        }
 
697
        
 
698
        attach_status_icon = new_attach;
 
699
        if (attach_status_icon) {
 
700
                g_object_add_weak_pointer (G_OBJECT (attach_status_icon),
 
701
                                           (gpointer) &attach_status_icon);
 
702
        }
 
703
}
 
704
 
689
705
static void
690
706
notify_hint_closed_cb (NotifyNotification *notification,
691
707
                       gpointer            user_data)
728
744
                return FALSE;
729
745
        }
730
746
 
731
 
        notify = notify_notification_new (summary, message, NULL, attach_widget);
 
747
        notify = notify_notification_new (summary, message, NULL, NULL);
732
748
        g_object_set_data_full (G_OBJECT (notify), "conf_path", g_strdup (conf_path), g_free);
733
749
        g_object_set_data (G_OBJECT (notify), "func", func);
734
750
        g_signal_connect (notify,
736
752
                          G_CALLBACK (notify_hint_closed_cb),
737
753
                          user_data);
738
754
 
 
755
        if (attach_status_icon) {
 
756
                notify_notification_attach_to_status_icon (notify, attach_status_icon);
 
757
        }
 
758
 
739
759
        if (!notify_notification_show (notify, &error)) {
740
760
                g_warning ("Failed to send notification: %s",
741
761
                           error->message);