pidgin: c6a58870: Clear the notifications via a signal ins...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Thu Jul 2 00:20:34 EDT 2009
-----------------------------------------------------------------
Revision: c6a588701073dae6f4d604aa3df792c3b114c22e
Ancestor: 800b6ad635fea0af0870d39010a2a305d65d3bea
Author: darkrain42 at pidgin.im
Date: 2009-07-02T04:15:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/c6a588701073dae6f4d604aa3df792c3b114c22e
Modified files:
pidgin/gtkmain.c pidgin/gtknotify.c pidgin/gtknotify.h
ChangeLog:
Clear the notifications via a signal instead of pidgin_close_notify.
If you have the detailed new mail window open when you sign off all accounts
with mail notifications, the window won't be closed, which is kinda weird.
Let's first see if this is on the right track before I go overboard.
Refs #9345. Sulabh, please test this!
-------------- next part --------------
============================================================
--- pidgin/gtkmain.c c9b471f6bd501804b270abf276191405f044da0c
+++ pidgin/gtkmain.c b9ccb31eaa81448337946cc7eeee120f96a4c3a0
@@ -313,6 +313,7 @@ pidgin_ui_init(void)
pidgin_smileys_init();
pidgin_utils_init();
pidgin_medias_init();
+ pidgin_notify_init();
}
static GHashTable *ui_info = NULL;
@@ -327,6 +328,7 @@ pidgin_quit(void)
/* Uninit */
pidgin_utils_uninit();
+ pidgin_notify_uninit();
pidgin_smileys_uninit();
pidgin_conversations_uninit();
pidgin_status_uninit();
============================================================
--- pidgin/gtknotify.c 6303d677202afc38232d3d4812280816f87db7db
+++ pidgin/gtknotify.c 71e1e85037467ea1e86006fef09b4cd7a7b00f03
@@ -301,6 +301,7 @@ email_response_cb(GtkDialog *dlg, gint i
if (id == GTK_RESPONSE_YES)
{
+ /* A single row activated. Remove that row. */
GtkTreeSelection *selection;
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
@@ -325,6 +326,7 @@ email_response_cb(GtkDialog *dlg, gint i
}
else
{
+ /* Remove all the rows */
while (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter))
{
gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), &iter,
@@ -1107,9 +1109,6 @@ pidgin_close_notify(PurpleNotifyType typ
{
PidginNotifyMailData *data = (PidginNotifyMailData *)ui_handle;
- /* Close the notification dialog */
- pidgin_notify_emails(purple_account_get_connection(data->account),
- 0, FALSE, NULL, NULL, NULL, NULL);
if (data) {
g_free(data->url);
g_free(data);
@@ -1567,6 +1566,33 @@ pidgin_get_notification_dialog(PidginNot
return pidgin_get_dialog(type, model);
}
+static void
+signed_off_cb(PurpleConnection *gc, gpointer unused)
+{
+ /* Clear any pending emails for this account */
+ pidgin_notify_emails(gc, 0, FALSE, NULL, NULL, NULL, NULL);
+}
+
+static void*
+pidgin_notify_get_handle(void)
+{
+ static int handle;
+ return &handle;
+}
+
+void pidgin_notify_init(void)
+{
+ void *handle = pidgin_notify_get_handle();
+
+ purple_signal_connect(purple_connections_get_handle(), "signed-off",
+ handle, PURPLE_CALLBACK(signed_off_cb), NULL);
+}
+
+void pidgin_notify_uninit(void)
+{
+ purple_signals_disconnect_by_handle(pidgin_notify_get_handle());
+}
+
static PurpleNotifyUiOps ops =
{
pidgin_notify_message,
============================================================
--- pidgin/gtknotify.h 8ee563e34247793fa22c453906c9d6ebfa3cab4b
+++ pidgin/gtknotify.h d8f8bf461bd4c5f2f2288f2fde68851635975c15
@@ -49,4 +49,14 @@ PurpleNotifyUiOps *pidgin_notify_get_ui_
*/
PurpleNotifyUiOps *pidgin_notify_get_ui_ops(void);
+/**
+ * Initializes the GTK+ notifications subsystem.
+ */
+void pidgin_notify_init(void);
+
+/**
+ * Uninitialized the GTK+ notifications subsystem.
+ */
+void pidgin_notify_uninit(void);
+
#endif /* _PIDGINNOTIFY_H_ */
More information about the Commits
mailing list