Mercurial > pidgin.yaz
annotate console/gntplugin.c @ 14105:eaf7f35635bc
[gaim-migrate @ 16739]
Allow autojoining chat rooms.
Sort the buddies in the buddylist, and the plugins in the plugin list.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 13 Aug 2006 23:30:19 +0000 |
parents | 2d1b41e3cf0d |
children | 44ec6c7cbc76 |
rev | line source |
---|---|
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
1 #include <gnt.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
2 #include <gntbox.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
3 #include <gntlabel.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 #include <gntline.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 #include <gnttree.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 #include "notify.h" |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 #include "gntgaim.h" |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 #include "gntplugin.h" |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 static struct |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 GntWidget *tree; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 GntWidget *window; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 GntWidget *aboot; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 } plugins; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
18 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 static void |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 plugin_toggled_cb(GntWidget *tree, GaimPlugin *plugin, gpointer null) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
21 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
22 if (gnt_tree_get_choice(GNT_TREE(tree), plugin)) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
24 if(!gaim_plugin_load(plugin)) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
25 gaim_notify_error(NULL, "ERROR", "loading plugin failed", NULL); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
26 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
27 else |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
28 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
29 if (!gaim_plugin_unload(plugin)) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
30 gaim_notify_error(NULL, "ERROR", "unloading plugin failed", NULL); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
31 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
32 gg_plugins_save_loaded(); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
33 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
34 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
35 /* Xerox */ |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
36 void |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
37 gg_plugins_save_loaded(void) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
38 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
39 GList *pl; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
40 GList *files = NULL; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
41 GaimPlugin *p; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
42 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
43 for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
44 p = pl->data; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
45 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
46 if (p->info->type != GAIM_PLUGIN_PROTOCOL && |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
47 p->info->type != GAIM_PLUGIN_LOADER) { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
48 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
49 files = g_list_append(files, p->path); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
50 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
52 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
53 gaim_prefs_set_string_list("/gaim/gnt/plugins/loaded", files); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
54 g_list_free(files); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
55 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
56 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
57 static void |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 selection_changed(GntWidget *widget, gpointer old, gpointer current, gpointer null) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
59 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 GaimPlugin *plugin = current; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 char *text; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
62 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
63 /* XXX: Use formatting and stuff */ |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 gnt_text_view_clear(GNT_TEXT_VIEW(plugins.aboot)); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 text = g_strdup_printf(_("Name: %s\nVersion: %s\nDescription: %s\nAuthor: %s\nWebsite: %s\nFilename: %s\n"), |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
66 plugin->info->name, plugin->info->version, plugin->info->description, |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 plugin->info->author, plugin->info->homepage, plugin->path); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(plugins.aboot), |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 text, GNT_TEXT_FLAG_NORMAL); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 gnt_text_view_scroll(GNT_TEXT_VIEW(plugins.aboot), 0); |
14105
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
71 g_free(text); |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 |
14024
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
74 static void |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
75 reset_plugin_window(GntWidget *window, gpointer null) |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
76 { |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
77 plugins.window = NULL; |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
78 plugins.tree = NULL; |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
79 plugins.aboot = NULL; |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
80 } |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
81 |
14105
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
82 static int |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
83 plugin_compare(GaimPlugin *p1, GaimPlugin *p2) |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
84 { |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
85 char *s1 = g_utf8_strup(p1->info->name, -1); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
86 char *s2 = g_utf8_strup(p2->info->name, -1); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
87 int ret = g_utf8_collate(s1, s2); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
88 g_free(s1); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
89 g_free(s2); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
90 return ret; |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
91 } |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
92 |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
93 void gg_plugins_show_all() |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
94 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
95 GntWidget *window, *tree, *box, *aboot; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
96 GList *iter; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
97 if (plugins.window) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 return; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
99 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
100 gaim_plugins_probe(G_MODULE_SUFFIX); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
101 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
102 plugins.window = window = gnt_vbox_new(FALSE); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
103 gnt_box_set_toplevel(GNT_BOX(window), TRUE); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
104 gnt_box_set_title(GNT_BOX(window), _("Plugins")); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
105 gnt_box_set_pad(GNT_BOX(window), 0); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
106 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
107 gnt_box_add_widget(GNT_BOX(window), |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
108 gnt_label_new(_("You can (un)load plugins from the following list."))); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
109 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new()); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
110 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
111 box = gnt_hbox_new(FALSE); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
112 gnt_box_add_widget(GNT_BOX(window), box); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
113 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new()); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
114 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
115 gnt_box_set_pad(GNT_BOX(box), 0); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
116 plugins.tree = tree = gnt_tree_new(); |
14105
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
117 gnt_tree_set_compare_func(GNT_TREE(tree), (GCompareFunc)plugin_compare); |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
118 GNT_WIDGET_SET_FLAGS(tree, GNT_WIDGET_NO_BORDER); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
119 gnt_box_add_widget(GNT_BOX(box), tree); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
120 gnt_box_add_widget(GNT_BOX(box), gnt_vline_new()); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
121 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
122 plugins.aboot = aboot = gnt_text_view_new(); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
123 gnt_widget_set_size(aboot, 40, 20); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
124 gnt_box_add_widget(GNT_BOX(box), aboot); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
125 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
126 for (iter = gaim_plugins_get_all(); iter; iter = iter->next) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
127 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
128 GaimPlugin *plug = iter->data; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
129 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
130 if (plug->info->type != GAIM_PLUGIN_STANDARD || |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
131 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE) || |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
132 plug->error) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
133 continue; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
134 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
135 gnt_tree_add_choice(GNT_TREE(tree), plug, |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
136 gnt_tree_create_row(GNT_TREE(tree), plug->info->name), NULL, NULL); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
137 gnt_tree_set_choice(GNT_TREE(tree), plug, gaim_plugin_is_loaded(plug)); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
138 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
139 gnt_tree_set_col_width(GNT_TREE(tree), 0, 30); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
140 g_signal_connect(G_OBJECT(tree), "toggled", G_CALLBACK(plugin_toggled_cb), NULL); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
141 g_signal_connect(G_OBJECT(tree), "selection_changed", G_CALLBACK(selection_changed), NULL); |
14024
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
142 g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(reset_plugin_window), NULL); |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
143 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
144 gnt_widget_show(window); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
145 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
146 |