| 301 |
301 |
| 302 if (unload) |
302 if (unload) |
| 303 { |
303 { |
| 304 pidgin_set_cursor(plugin_dialog, GDK_WATCH); |
304 pidgin_set_cursor(plugin_dialog, GDK_WATCH); |
| 305 |
305 |
| 306 purple_plugin_unload(plug); |
306 if (!purple_plugin_unload(plug)) |
| |
307 { |
| |
308 const char *primary = _("Could not unload plugin"); |
| |
309 const char *reload = _("The plugin could not be unloaded now, but will be disabled at the next startup."); |
| |
310 |
| |
311 if (!plug->error) |
| |
312 { |
| |
313 purple_notify_warning(NULL, NULL, primary, reload); |
| |
314 } |
| |
315 else |
| |
316 { |
| |
317 char *tmp = g_strdup_printf("%s\n\n%s", reload, plug->error); |
| |
318 purple_notify_warning(NULL, NULL, primary, tmp); |
| |
319 g_free(tmp); |
| |
320 } |
| |
321 |
| |
322 purple_plugin_disable(plug); |
| |
323 } |
| 307 |
324 |
| 308 pidgin_clear_cursor(plugin_dialog); |
325 pidgin_clear_cursor(plugin_dialog); |
| 309 } |
326 } |
| 310 |
327 |
| 311 gtk_widget_set_sensitive(pref_button, |
328 gtk_widget_set_sensitive(pref_button, |
| 514 plugin_dialog_response_cb(dialog, PIDGIN_RESPONSE_CONFIGURE, sel); |
531 plugin_dialog_response_cb(dialog, PIDGIN_RESPONSE_CONFIGURE, sel); |
| 515 } |
532 } |
| 516 |
533 |
| 517 void pidgin_plugin_dialog_show() |
534 void pidgin_plugin_dialog_show() |
| 518 { |
535 { |
| 519 pidgin_plugin_dialog_show_with_parent(NULL); |
|
| 520 } |
|
| 521 |
|
| 522 void pidgin_plugin_dialog_show_with_parent(GtkWindow *parent) |
|
| 523 { |
|
| 524 GtkWidget *sw; |
536 GtkWidget *sw; |
| 525 GtkWidget *event_view; |
537 GtkWidget *event_view; |
| 526 GtkListStore *ls; |
538 GtkListStore *ls; |
| 527 GtkCellRenderer *rend, *rendt; |
539 GtkCellRenderer *rend, *rendt; |
| 528 GtkTreeViewColumn *col; |
540 GtkTreeViewColumn *col; |
| 529 GtkTreeSelection *sel; |
541 GtkTreeSelection *sel; |
| 530 |
542 |
| 531 if (plugin_dialog != NULL) { |
543 if (plugin_dialog != NULL) { |
| 532 if (parent) |
|
| 533 gtk_window_set_transient_for(GTK_WINDOW(plugin_dialog), parent); |
|
| 534 gtk_window_present(GTK_WINDOW(plugin_dialog)); |
544 gtk_window_present(GTK_WINDOW(plugin_dialog)); |
| 535 return; |
545 return; |
| 536 } |
546 } |
| 537 |
547 |
| 538 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"), |
548 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"), |
| 539 NULL, |
549 NULL, |
| 540 GTK_DIALOG_NO_SEPARATOR, |
550 GTK_DIALOG_NO_SEPARATOR, |
| 541 NULL); |
551 NULL); |
| 542 if (parent) |
|
| 543 gtk_window_set_transient_for(GTK_WINDOW(plugin_dialog), parent); |
|
| 544 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
552 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
| 545 _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE); |
553 _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE); |
| 546 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
554 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), |
| 547 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
555 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); |
| 548 gtk_widget_set_sensitive(pref_button, FALSE); |
556 gtk_widget_set_sensitive(pref_button, FALSE); |