| 31 #include "prefs.h" |
31 #include "prefs.h" |
| 32 #include "request.h" |
32 #include "request.h" |
| 33 |
33 |
| 34 #include <string.h> |
34 #include <string.h> |
| 35 |
35 |
| 36 #define GAIM_RESPONSE_CONFIGURE 98121 |
36 #define PIDGIN_RESPONSE_CONFIGURE 98121 |
| 37 |
37 |
| 38 static void plugin_toggled_stage_two(GaimPlugin *plug, GtkTreeModel *model, |
38 static void plugin_toggled_stage_two(GaimPlugin *plug, GtkTreeModel *model, |
| 39 GtkTreeIter *iter, gboolean unload); |
39 GtkTreeIter *iter, gboolean unload); |
| 40 |
40 |
| 41 static GtkWidget *expander = NULL; |
41 static GtkWidget *expander = NULL; |
| 453 g_hash_table_destroy(plugin_pref_dialogs); |
453 g_hash_table_destroy(plugin_pref_dialogs); |
| 454 plugin_pref_dialogs = NULL; |
454 plugin_pref_dialogs = NULL; |
| 455 } |
455 } |
| 456 plugin_dialog = NULL; |
456 plugin_dialog = NULL; |
| 457 break; |
457 break; |
| 458 case GAIM_RESPONSE_CONFIGURE: |
458 case PIDGIN_RESPONSE_CONFIGURE: |
| 459 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
459 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
| 460 return; |
460 return; |
| 461 val.g_type = 0; |
461 val.g_type = 0; |
| 462 gtk_tree_model_get_value(model, &iter, 2, &val); |
462 gtk_tree_model_get_value(model, &iter, 2, &val); |
| 463 plug = g_value_get_pointer(&val); |
463 plug = g_value_get_pointer(&val); |
| 506 |
506 |
| 507 if (!gaim_plugin_is_loaded(plugin)) |
507 if (!gaim_plugin_is_loaded(plugin)) |
| 508 return; |
508 return; |
| 509 |
509 |
| 510 /* Now show the pref-dialog for the plugin */ |
510 /* Now show the pref-dialog for the plugin */ |
| 511 plugin_dialog_response_cb(dialog, GAIM_RESPONSE_CONFIGURE, sel); |
511 plugin_dialog_response_cb(dialog, PIDGIN_RESPONSE_CONFIGURE, sel); |
| 512 } |
512 } |
| 513 |
513 |
| 514 void pidgin_plugin_dialog_show() |
514 void pidgin_plugin_dialog_show() |
| 515 { |
515 { |
| 516 GtkWidget *sw; |
516 GtkWidget *sw; |
| 528 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"), |
528 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"), |
| 529 NULL, |
529 NULL, |
| 530 GTK_DIALOG_NO_SEPARATOR, |
530 GTK_DIALOG_NO_SEPARATOR, |
| 531 NULL); |
531 NULL); |
| 532 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
532 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
| 533 _("Configure Pl_ugin"), GAIM_RESPONSE_CONFIGURE); |
533 _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE); |
| 534 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
534 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
| 535 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
535 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
| 536 gtk_widget_set_sensitive(pref_button, FALSE); |
536 gtk_widget_set_sensitive(pref_button, FALSE); |
| 537 gtk_window_set_role(GTK_WINDOW(plugin_dialog), "plugins"); |
537 gtk_window_set_role(GTK_WINDOW(plugin_dialog), "plugins"); |
| 538 |
538 |