changeset 21618:85fc97ffe538

Workarounds to fix some issues with the minidialog and scrollbook.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 22 Nov 2007 19:34:50 +0000
parents 4ddc6e16c3ed
children 30b634a8908d 6f6f8af235eb b2aa68cdc8b9 1c139f0493b9
files pidgin/gtkblist.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Thu Nov 22 19:09:32 2007 +0000
+++ b/pidgin/gtkblist.c	Thu Nov 22 19:34:50 2007 +0000
@@ -4441,8 +4441,12 @@
                              PurpleAccount *account)
 {
 	GList *l = NULL;
-	GList *children = gtk_container_get_children(container);
+	GList *children = NULL;
 	GtkWidget *ret = NULL;
+	/* XXX: Workaround for the currently incomplete implementation of PidginScrollBook */
+	if (PIDGIN_IS_SCROLL_BOOK(container))
+		container = PIDGIN_SCROLL_BOOK(container)->notebook;
+	children = gtk_container_get_children(container);
 	l = g_list_find_custom(children, account, (GCompareFunc) find_account_widget);
 	if (l)
 		ret = GTK_WIDGET(l->data);
@@ -4456,7 +4460,6 @@
 {
 	GtkWidget *widget = find_child_widget_by_account(container, account);
 	if(widget) {
-		gtk_container_remove(container, widget);
 		gtk_widget_destroy(widget);
 	}
 }
@@ -4620,7 +4623,7 @@
 
 	if(priv->signed_on_elsewhere)
 		return;
-	
+
 	mini_dialog = priv->signed_on_elsewhere =
 		pidgin_mini_dialog_new(NULL, NULL, PIDGIN_STOCK_DISCONNECT);
 
@@ -4649,6 +4652,10 @@
 		return;
 
 	accounts = pidgin_mini_dialog_get_num_children(mini_dialog);
+	if (accounts == 0) {
+		gtk_widget_destroy(GTK_WIDGET(mini_dialog));
+		return;
+	}
 
 	title = g_strdup_printf(
 		ngettext("%d account was disabled because you signed on from another location.",