Mercurial > pidgin.yaz
comparison src/gtkplugin.c @ 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 | f17958be25ab |
children | e856f985a0b9 |
comparison
equal
deleted
inserted
replaced
12342:0692d20d9d81 | 12343:a02f877637a6 |
---|---|
31 | 31 |
32 #include <string.h> | 32 #include <string.h> |
33 | 33 |
34 #define GAIM_RESPONSE_CONFIGURE 98121 | 34 #define GAIM_RESPONSE_CONFIGURE 98121 |
35 | 35 |
36 static GtkWidget *expander = NULL; | |
36 static GtkWidget *plugin_dialog = NULL; | 37 static GtkWidget *plugin_dialog = NULL; |
37 static GtkWidget *plugin_details = NULL; | 38 static GtkWidget *plugin_details = NULL; |
38 static GtkWidget *pref_button = NULL; | 39 static GtkWidget *pref_button = NULL; |
39 static GHashTable *plugin_pref_dialogs = NULL; | 40 static GHashTable *plugin_pref_dialogs = NULL; |
40 | 41 |
241 if (!gtk_tree_selection_get_selected (sel, &model, &iter)) | 242 if (!gtk_tree_selection_get_selected (sel, &model, &iter)) |
242 { | 243 { |
243 /* Clear the old plugin details */ | 244 /* Clear the old plugin details */ |
244 gtk_label_set_markup(GTK_LABEL(plugin_details), ""); | 245 gtk_label_set_markup(GTK_LABEL(plugin_details), ""); |
245 gtk_widget_set_sensitive(pref_button, FALSE); | 246 gtk_widget_set_sensitive(pref_button, FALSE); |
247 | |
248 /* Collapse and disable the expander widget */ | |
249 gtk_expander_set_expanded(GTK_EXPANDER(expander), FALSE); | |
250 gtk_widget_set_sensitive(expander, FALSE); | |
251 | |
246 return; | 252 return; |
247 } | 253 } |
254 | |
255 gtk_widget_set_sensitive(expander, TRUE); | |
248 | 256 |
249 gtk_tree_model_get_value (model, &iter, 2, &val); | 257 gtk_tree_model_get_value (model, &iter, 2, &val); |
250 plug = g_value_get_pointer(&val); | 258 plug = g_value_get_pointer(&val); |
251 | 259 |
252 pname = g_markup_escape_text(_(plug->info->name), -1); | 260 pname = g_markup_escape_text(_(plug->info->name), -1); |
364 GtkWidget *event_view; | 372 GtkWidget *event_view; |
365 GtkListStore *ls; | 373 GtkListStore *ls; |
366 GtkCellRenderer *rend, *rendt; | 374 GtkCellRenderer *rend, *rendt; |
367 GtkTreeViewColumn *col; | 375 GtkTreeViewColumn *col; |
368 GtkTreeSelection *sel; | 376 GtkTreeSelection *sel; |
369 GtkWidget *expander; | |
370 | 377 |
371 if (plugin_dialog != NULL) { | 378 if (plugin_dialog != NULL) { |
372 gtk_window_present(GTK_WINDOW(plugin_dialog)); | 379 gtk_window_present(GTK_WINDOW(plugin_dialog)); |
373 return; | 380 return; |
374 } | 381 } |
430 expander = gtk_expander_new(_("<b>Plugin Details</b>")); | 437 expander = gtk_expander_new(_("<b>Plugin Details</b>")); |
431 gtk_expander_set_use_markup(GTK_EXPANDER(expander), TRUE); | 438 gtk_expander_set_use_markup(GTK_EXPANDER(expander), TRUE); |
432 plugin_details = gtk_label_new(NULL); | 439 plugin_details = gtk_label_new(NULL); |
433 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | 440 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); |
434 gtk_container_add(GTK_CONTAINER(expander), plugin_details); | 441 gtk_container_add(GTK_CONTAINER(expander), plugin_details); |
442 gtk_widget_set_sensitive(expander, FALSE); | |
435 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), expander, FALSE, FALSE, 0); | 443 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(plugin_dialog)->vbox), expander, FALSE, FALSE, 0); |
436 | 444 |
437 g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (prefs_plugin_sel), NULL); | 445 g_signal_connect (G_OBJECT (sel), "changed", G_CALLBACK (prefs_plugin_sel), NULL); |
438 g_signal_connect(G_OBJECT(plugin_dialog), "response", G_CALLBACK(plugin_dialog_response_cb), sel); | 446 g_signal_connect(G_OBJECT(plugin_dialog), "response", G_CALLBACK(plugin_dialog_response_cb), sel); |
439 gtk_window_set_default_size(GTK_WINDOW(plugin_dialog), 430, 430); | 447 gtk_window_set_default_size(GTK_WINDOW(plugin_dialog), 430, 430); |