diff console/gntaccount.c @ 14024:7109e6397a31

[gaim-migrate @ 16622] Add commands /accounts, /buddylist, /debugwin and /plugins. It allows the user to close those windows, and pop them back up when necessary -- provided a conversation window is open -- which I am assuming would be the case most of the time. Until there's some better way of accessing these dialogs (eg. menus), this is the only way. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 03 Aug 2006 07:16:35 +0000
parents a7b1d2ab9cb0
children 27182f83b79b
line wrap: on
line diff
--- a/console/gntaccount.c	Wed Aug 02 23:52:45 2006 +0000
+++ b/console/gntaccount.c	Thu Aug 03 07:16:35 2006 +0000
@@ -548,6 +548,13 @@
 	gaim_account_set_enabled(account, GAIM_GNT_UI, gnt_tree_get_choice(GNT_TREE(widget), key));
 }
 
+static void
+reset_accounts_win(GntWidget *widget, gpointer null)
+{
+	accounts.window = NULL;
+	accounts.tree = NULL;
+}
+
 void gg_accounts_show_all()
 {
 	GList *iter;
@@ -597,6 +604,8 @@
 	g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(delete_account_cb), accounts.tree);
 	
 	gnt_box_add_widget(GNT_BOX(accounts.window), box);
+
+	g_signal_connect(G_OBJECT(accounts.window), "destroy", G_CALLBACK(reset_accounts_win), NULL);
 	
 	gnt_widget_show(accounts.window);
 }
@@ -641,7 +650,8 @@
 
 void gg_accounts_uninit()
 {
-	gnt_widget_destroy(accounts.window);
+	if (accounts.window)
+		gnt_widget_destroy(accounts.window);
 }
 
 /* The following uiops stuff are copied from gtkaccount.c */