changeset 12343:a02f877637a6

[gaim-migrate @ 14647] If no plugin is selected the plugins dialog, then ensure the expander is collapsed and disabled committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 05 Dec 2005 04:32:32 +0000
parents 0692d20d9d81
children 719c5b4668b9
files src/gtkplugin.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkplugin.c	Mon Dec 05 04:19:07 2005 +0000
+++ b/src/gtkplugin.c	Mon Dec 05 04:32:32 2005 +0000
@@ -33,6 +33,7 @@
 
 #define GAIM_RESPONSE_CONFIGURE 98121
 
+static GtkWidget *expander = NULL;
 static GtkWidget *plugin_dialog = NULL;
 static GtkWidget *plugin_details = NULL;
 static GtkWidget *pref_button = NULL;
@@ -243,9 +244,16 @@
 		/* Clear the old plugin details */
 		gtk_label_set_markup(GTK_LABEL(plugin_details), "");
 		gtk_widget_set_sensitive(pref_button, FALSE);
+
+		/* Collapse and disable the expander widget */
+		gtk_expander_set_expanded(GTK_EXPANDER(expander), FALSE);
+		gtk_widget_set_sensitive(expander, FALSE);
+
 		return;
 	}
 
+	gtk_widget_set_sensitive(expander, TRUE);
+
 	gtk_tree_model_get_value (model, &iter, 2, &val);
 	plug = g_value_get_pointer(&val);
 
@@ -366,7 +374,6 @@
 	GtkCellRenderer *rend, *rendt;
 	GtkTreeViewColumn *col;
 	GtkTreeSelection *sel;
-	GtkWidget *expander;
 
 	if (plugin_dialog != NULL) {
 		gtk_window_present(GTK_WINDOW(plugin_dialog));
@@ -432,6 +439,7 @@
 	plugin_details = gtk_label_new(NULL);
 	gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE);
 	gtk_container_add(GTK_CONTAINER(expander), plugin_details);
+	gtk_widget_set_sensitive(expander, FALSE);
 	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), expander, FALSE, FALSE, 0);
 
 	g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (prefs_plugin_sel), NULL);