comparison pidgin/gtkplugin.c @ 21229:0b67d509a305

merge of '1bcf84e26d11f259b3c5ec663e3fecc2f01aed33' and 'ce13b5ca4994abbd4934b3bc568c8b115335c426'
author Richard Laager <rlaager@wiktel.com>
date Sun, 14 Oct 2007 02:41:00 +0000
parents 84b9b98070e5 059d6deebee7
children fba1f6c3df0b 80af064d311c
comparison
equal deleted inserted replaced
21098:7e200a629109 21229:0b67d509a305
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 {
536 pidgin_plugin_dialog_show_with_parent(NULL);
537 }
538
539 void pidgin_plugin_dialog_show_with_parent(GtkWindow *parent)
540 {
519 GtkWidget *sw; 541 GtkWidget *sw;
520 GtkWidget *event_view; 542 GtkWidget *event_view;
521 GtkListStore *ls; 543 GtkListStore *ls;
522 GtkCellRenderer *rend, *rendt; 544 GtkCellRenderer *rend, *rendt;
523 GtkTreeViewColumn *col; 545 GtkTreeViewColumn *col;
524 GtkTreeSelection *sel; 546 GtkTreeSelection *sel;
525 547
526 if (plugin_dialog != NULL) { 548 if (plugin_dialog != NULL) {
549 if (parent)
550 gtk_window_set_transient_for(GTK_WINDOW(plugin_dialog), parent);
527 gtk_window_present(GTK_WINDOW(plugin_dialog)); 551 gtk_window_present(GTK_WINDOW(plugin_dialog));
528 return; 552 return;
529 } 553 }
530 554
531 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"), 555 plugin_dialog = gtk_dialog_new_with_buttons(_("Plugins"),
532 NULL, 556 NULL,
533 GTK_DIALOG_NO_SEPARATOR, 557 GTK_DIALOG_NO_SEPARATOR,
534 NULL); 558 NULL);
559 if (parent)
560 gtk_window_set_transient_for(GTK_WINDOW(plugin_dialog), parent);
535 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), 561 pref_button = gtk_dialog_add_button(GTK_DIALOG(plugin_dialog),
536 _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE); 562 _("Configure Pl_ugin"), PIDGIN_RESPONSE_CONFIGURE);
537 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog), 563 gtk_dialog_add_button(GTK_DIALOG(plugin_dialog),
538 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); 564 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
539 gtk_widget_set_sensitive(pref_button, FALSE); 565 gtk_widget_set_sensitive(pref_button, FALSE);