changeset 18198:9cb31b7c2dd6

Close all delete-confirmation dialogs for it when a status is deleted.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 19 Jun 2007 19:23:25 +0000
parents 9287055b97d2
children 1bb3b07a6879
files libpurple/savedstatuses.c pidgin/gtksavedstatuses.c pidgin/gtkstatusbox.c
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/savedstatuses.c	Tue Jun 19 18:59:12 2007 +0000
+++ b/libpurple/savedstatuses.c	Tue Jun 19 19:23:25 2007 +0000
@@ -29,6 +29,7 @@
 #include "notify.h"
 #include "savedstatuses.h"
 #include "dbus-maybe.h"
+#include "request.h"
 #include "status.h"
 #include "util.h"
 #include "xmlnode.h"
@@ -110,6 +111,7 @@
 	g_return_if_fail(substatus != NULL);
 
 	g_free(substatus->message);
+	purple_request_close_with_handle(substatus);
 	PURPLE_DBUS_UNREGISTER_POINTER(substatus);
 	g_free(substatus);
 }
@@ -128,7 +130,7 @@
 		status->substatuses = g_list_remove(status->substatuses, substatus);
 		free_saved_status_sub(substatus);
 	}
-
+	purple_request_close_with_handle(status);
 	PURPLE_DBUS_UNREGISTER_POINTER(status);
 	g_free(status);
 }
--- a/pidgin/gtksavedstatuses.c	Tue Jun 19 18:59:12 2007 +0000
+++ b/pidgin/gtksavedstatuses.c	Tue Jun 19 19:23:25 2007 +0000
@@ -304,6 +304,7 @@
 	GList *sel_paths, *l, *sel_titles = NULL;
 	GtkTreeModel *model = GTK_TREE_MODEL(dialog->model);
 	char *title;
+	gpointer handle;
 
 	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview));
 #if GTK_CHECK_VERSION(2,2,0)
@@ -326,13 +327,16 @@
 	}
 	g_list_free(sel_paths);
 
-	if (g_list_length(sel_titles) == 1)
+	if (g_list_length(sel_titles) == 1) {
 		title = g_strdup_printf(_("Are you sure you want to delete %s?"),
 				(const gchar *)sel_titles->data);
-	else
+		handle = purple_savedstatus_find(sel_titles->data);
+	} else {
 		title = g_strdup(_("Are you sure you want to delete the selected saved statuses?"));
+		handle = dialog;
+	}
 
-	purple_request_action(dialog, NULL, title, NULL, 0,
+	purple_request_action(handle, NULL, title, NULL, 0,
 		 NULL, NULL, NULL,
 		 sel_titles, 2,
 		_("Delete"), status_window_delete_confirm_cb,
--- a/pidgin/gtkstatusbox.c	Tue Jun 19 18:59:12 2007 +0000
+++ b/pidgin/gtkstatusbox.c	Tue Jun 19 19:23:25 2007 +0000
@@ -1560,7 +1560,7 @@
 
 	msg = g_strdup_printf(_("Are you sure you want to delete %s?"), purple_savedstatus_get_title(saved));
 
-	purple_request_action(pidgin_status_get_handle(), NULL, msg, NULL, 0,
+	purple_request_action(saved, NULL, msg, NULL, 0,
 		NULL, NULL, NULL,
 		data, 2,
 		_("Delete"), tree_view_delete_current_selection_cb,