| 44 G_DEFINE_TYPE_WITH_PRIVATE(PidginDebugPluginInfo, pidgin_debug_plugin_info, GTK_TYPE_DIALOG) |
44 G_DEFINE_TYPE_WITH_PRIVATE(PidginDebugPluginInfo, pidgin_debug_plugin_info, GTK_TYPE_DIALOG) |
| 45 |
45 |
| 46 /****************************************************************************** |
46 /****************************************************************************** |
| 47 * Helpers |
47 * Helpers |
| 48 *****************************************************************************/ |
48 *****************************************************************************/ |
| |
49 static gint |
| |
50 purple_debug_plugin_compare_plugin_id(gconstpointer a, gconstpointer b) { |
| |
51 return g_strcmp0( |
| |
52 purple_plugin_info_get_id(purple_plugin_get_info(PURPLE_PLUGIN(a))), |
| |
53 purple_plugin_info_get_id(purple_plugin_get_info(PURPLE_PLUGIN(b))) |
| |
54 ); |
| |
55 } |
| |
56 |
| 49 static gchar * |
57 static gchar * |
| 50 pidgin_debug_plugin_info_build_html(void) { |
58 pidgin_debug_plugin_info_build_html(void) { |
| 51 GString *str = g_string_new(NULL); |
59 GString *str = g_string_new(NULL); |
| 52 GList *plugins = NULL, *l = NULL; |
60 GList *plugins = NULL, *l = NULL; |
| 53 GError *error = NULL; |
61 GError *error = NULL; |
| 54 gchar *ret = NULL; |
62 gchar *ret = NULL; |
| 55 |
63 |
| 56 g_string_append_printf(str, "<h2>%s</h2><dl>", _("Plugin Information")); |
64 g_string_append_printf(str, "<h2>%s</h2><dl>", _("Plugin Information")); |
| 57 |
65 |
| 58 plugins = purple_plugins_find_all(); |
66 plugins = g_list_sort( |
| |
67 purple_plugins_find_all(), |
| |
68 purple_debug_plugin_compare_plugin_id |
| |
69 ); |
| |
70 |
| 59 for(l = plugins; l != NULL; l = l->next) { |
71 for(l = plugins; l != NULL; l = l->next) { |
| 60 PurplePlugin *plugin = PURPLE_PLUGIN(l->data); |
72 PurplePlugin *plugin = PURPLE_PLUGIN(l->data); |
| 61 PurplePluginInfo *info = purple_plugin_get_info(plugin); |
73 PurplePluginInfo *info = purple_plugin_get_info(plugin); |
| 62 PurplePluginExtraCb extra_cb; |
74 PurplePluginExtraCb extra_cb; |
| 63 gchar *name = g_markup_escape_text(purple_plugin_info_get_name(info), -1); |
75 gchar *name = g_markup_escape_text(purple_plugin_info_get_name(info), -1); |