comparison finch/gntplugin.c @ 16254:c3052de39110

If a plugin failed to load/unload, don't pretend that it worked
author Richard Nelson <wabz@pidgin.im>
date Thu, 19 Apr 2007 01:21:25 +0000
parents 0f0832c13fcb
children 8c89913276b3
comparison
equal deleted inserted replaced
16251:017405933589 16254:c3052de39110
61 } 61 }
62 62
63 static void 63 static void
64 plugin_toggled_cb(GntWidget *tree, PurplePlugin *plugin, gpointer null) 64 plugin_toggled_cb(GntWidget *tree, PurplePlugin *plugin, gpointer null)
65 { 65 {
66 /* TODO: Mark these strings for translation after the freeze */
66 if (gnt_tree_get_choice(GNT_TREE(tree), plugin)) 67 if (gnt_tree_get_choice(GNT_TREE(tree), plugin))
67 { 68 {
68 if(!purple_plugin_load(plugin)) 69 if (!purple_plugin_load(plugin)) {
69 purple_notify_error(NULL, "ERROR", "loading plugin failed", NULL); 70 purple_notify_error(NULL, "ERROR", "loading plugin failed", NULL);
71 gnt_tree_set_choice(GNT_TREE(tree), plugin, FALSE);
72 }
70 } 73 }
71 else 74 else
72 { 75 {
73 GntWidget *win; 76 GntWidget *win;
74 77
75 if (!purple_plugin_unload(plugin)) 78 if (!purple_plugin_unload(plugin)) {
76 purple_notify_error(NULL, "ERROR", "unloading plugin failed", NULL); 79 purple_notify_error(NULL, "ERROR", "unloading plugin failed", NULL);
80 gnt_tree_set_choice(GNT_TREE(tree), plugin, TRUE);
81 }
77 82
78 if ((win = g_hash_table_lookup(confwins, plugin)) != NULL) 83 if ((win = g_hash_table_lookup(confwins, plugin)) != NULL)
79 { 84 {
80 gnt_widget_destroy(win); 85 gnt_widget_destroy(win);
81 } 86 }