# HG changeset patch # User Richard Laager # Date 1191773180 0 # Node ID 3695fbebc8bf9558f6f98fc6d06d14b383233a40 # Parent 31821456d93f8f6d8a964d42d9985cb00db16769 Use the new purple_plugin_disable() function and purple_plugin_unload()'s setting of plugin->error to display an appropriate message if a plugin fails to unload. diff -r 31821456d93f -r 3695fbebc8bf pidgin/gtkplugin.c --- a/pidgin/gtkplugin.c Sun Oct 07 16:03:37 2007 +0000 +++ b/pidgin/gtkplugin.c Sun Oct 07 16:06:20 2007 +0000 @@ -303,7 +303,24 @@ { pidgin_set_cursor(plugin_dialog, GDK_WATCH); - purple_plugin_unload(plug); + if (!purple_plugin_unload(plug)) + { + const char *primary = _("Could not unload plugin"); + const char *reload = _("The plugin could not be unloaded now, but will be disabled at the next startup."); + + if (!plug->error) + { + purple_notify_warning(NULL, NULL, primary, reload); + } + else + { + char *tmp = g_strdup_printf("%s\n\n%s", reload, plug->error); + purple_notify_warning(NULL, NULL, primary, tmp); + g_free(tmp); + } + + purple_plugin_disable(plug); + } pidgin_clear_cursor(plugin_dialog); }