Mercurial > pidgin
annotate console/gntplugin.c @ 14502:09900227d1b9
[gaim-migrate @ 17221]
Change CVS to SVN in the C plugin howto
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 10 Sep 2006 20:03:24 +0000 |
parents | 5b9daf111b42 |
children | 81650a27f253 |
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> |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
3 #include <gntbutton.h> |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
4 #include <gntlabel.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
5 #include <gntline.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
6 #include <gnttree.h> |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
7 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
8 #include "notify.h" |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
9 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
10 #include "gntgaim.h" |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
11 #include "gntplugin.h" |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
12 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
13 static struct |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
14 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
15 GntWidget *tree; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
16 GntWidget *window; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
17 GntWidget *aboot; |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
18 GntWidget *conf; |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
19 } plugins; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
20 |
14148
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
21 static GHashTable *confwins; |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
22 |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
23 static void |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
24 decide_conf_button(GaimPlugin *plugin) |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
25 { |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
26 if (gaim_plugin_is_loaded(plugin) && |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
27 ((GAIM_IS_GNT_PLUGIN(plugin) && |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
28 GAIM_GNT_PLUGIN_UI_INFO(plugin) != NULL) || |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
29 (plugin->info->prefs_info && |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
30 plugin->info->prefs_info->get_plugin_pref_frame))) |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
31 gnt_widget_set_visible(plugins.conf, TRUE); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
32 else |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
33 gnt_widget_set_visible(plugins.conf, FALSE); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
34 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
35 gnt_box_readjust(GNT_BOX(plugins.window)); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
36 gnt_widget_draw(plugins.window); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
37 } |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
38 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
39 static void |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
40 plugin_toggled_cb(GntWidget *tree, GaimPlugin *plugin, gpointer null) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
41 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
42 if (gnt_tree_get_choice(GNT_TREE(tree), plugin)) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
43 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
44 if(!gaim_plugin_load(plugin)) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
45 gaim_notify_error(NULL, "ERROR", "loading plugin failed", NULL); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
46 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
47 else |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
48 { |
14148
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
49 GntWidget *win; |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
50 |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
51 if (!gaim_plugin_unload(plugin)) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
52 gaim_notify_error(NULL, "ERROR", "unloading plugin failed", NULL); |
14148
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
53 |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
54 if ((win = g_hash_table_lookup(confwins, plugin)) != NULL) |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
55 { |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
56 gnt_widget_destroy(win); |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
57 } |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
58 } |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
59 decide_conf_button(plugin); |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
60 gg_plugins_save_loaded(); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
61 } |
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 /* Xerox */ |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
64 void |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
65 gg_plugins_save_loaded(void) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
66 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
67 GList *pl; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
68 GList *files = NULL; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
69 GaimPlugin *p; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
70 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
71 for (pl = gaim_plugins_get_loaded(); pl != NULL; pl = pl->next) { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
72 p = pl->data; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
73 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
74 if (p->info->type != GAIM_PLUGIN_PROTOCOL && |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
75 p->info->type != GAIM_PLUGIN_LOADER) { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
76 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
77 files = g_list_append(files, p->path); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
78 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
79 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
80 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
81 gaim_prefs_set_string_list("/gaim/gnt/plugins/loaded", files); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
82 g_list_free(files); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
83 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
84 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
85 static void |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
86 selection_changed(GntWidget *widget, gpointer old, gpointer current, gpointer null) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
87 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
88 GaimPlugin *plugin = current; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
89 char *text; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
90 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
91 /* XXX: Use formatting and stuff */ |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
92 gnt_text_view_clear(GNT_TEXT_VIEW(plugins.aboot)); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
93 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
|
94 plugin->info->name, plugin->info->version, plugin->info->description, |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
95 plugin->info->author, plugin->info->homepage, plugin->path); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
96 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
|
97 text, GNT_TEXT_FLAG_NORMAL); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
98 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
|
99 g_free(text); |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
100 decide_conf_button(plugin); |
14010
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 |
14024
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
103 static void |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
104 reset_plugin_window(GntWidget *window, gpointer null) |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
105 { |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
106 plugins.window = NULL; |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
107 plugins.tree = NULL; |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
108 plugins.aboot = NULL; |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
109 } |
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
110 |
14105
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
111 static int |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
112 plugin_compare(GaimPlugin *p1, GaimPlugin *p2) |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
113 { |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
114 char *s1 = g_utf8_strup(p1->info->name, -1); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
115 char *s2 = g_utf8_strup(p2->info->name, -1); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
116 int ret = g_utf8_collate(s1, s2); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
117 g_free(s1); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
118 g_free(s2); |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
119 return ret; |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
120 } |
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
121 |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
122 static void |
14148
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
123 confwin_init() |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
124 { |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
125 confwins = g_hash_table_new(g_direct_hash, g_direct_equal); |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
126 } |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
127 |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
128 static void |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
129 remove_confwin(GntWidget *window, gpointer plugin) |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
130 { |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
131 g_hash_table_remove(confwins, plugin); |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
132 } |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
133 |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
134 static void |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
135 configure_plugin_cb(GntWidget *button, gpointer null) |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
136 { |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
137 GaimPlugin *plugin; |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
138 GGPluginFrame callback; |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
139 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
140 g_return_if_fail(plugins.tree != NULL); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
141 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
142 plugin = gnt_tree_get_selection_data(GNT_TREE(plugins.tree)); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
143 if (!gaim_plugin_is_loaded(plugin)) |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
144 { |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
145 gaim_notify_error(plugin, _("Error"), |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
146 _("Plugin need to be loaded before you can configure it."), NULL); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
147 return; |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
148 } |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
149 |
14148
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
150 if (confwins && g_hash_table_lookup(confwins, plugin)) |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
151 return; |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
152 |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
153 if (GAIM_IS_GNT_PLUGIN(plugin) && |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
154 (callback = GAIM_GNT_PLUGIN_UI_INFO(plugin)) != NULL) |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
155 { |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
156 GntWidget *window = gnt_vbox_new(FALSE); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
157 GntWidget *box, *button; |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
158 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
159 gnt_box_set_toplevel(GNT_BOX(window), TRUE); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
160 gnt_box_set_title(GNT_BOX(window), plugin->info->name); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
161 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
162 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
163 box = callback(); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
164 gnt_box_add_widget(GNT_BOX(window), box); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
165 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
166 box = gnt_hbox_new(FALSE); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
167 gnt_box_add_widget(GNT_BOX(window), box); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
168 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
169 button = gnt_button_new(_("Close")); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
170 gnt_box_add_widget(GNT_BOX(box), button); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
171 g_signal_connect_swapped(G_OBJECT(button), "activate", |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
172 G_CALLBACK(gnt_widget_destroy), window); |
14148
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
173 g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(remove_confwin), plugin); |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
174 |
14148
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
175 gnt_widget_show(window); |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
176 |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
177 if (confwins == NULL) |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
178 confwin_init(); |
5b9daf111b42
[gaim-migrate @ 16793]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14139
diff
changeset
|
179 g_hash_table_insert(confwins, plugin, window); |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
180 } |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
181 else if (plugin->info->prefs_info && |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
182 plugin->info->prefs_info->get_plugin_pref_frame) |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
183 { |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
184 gaim_notify_info(plugin, _("..."), |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
185 _("Still need to do something about this."), NULL); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
186 return; |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
187 } |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
188 else |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
189 { |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
190 gaim_notify_info(plugin, _("Error"), |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
191 _("No configuration options for this plugin."), NULL); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
192 return; |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
193 } |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
194 } |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
195 |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
196 void gg_plugins_show_all() |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
197 { |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
198 GntWidget *window, *tree, *box, *aboot, *button; |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
199 GList *iter; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
200 if (plugins.window) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
201 return; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
202 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
203 gaim_plugins_probe(G_MODULE_SUFFIX); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
204 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
205 plugins.window = window = gnt_vbox_new(FALSE); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
206 gnt_box_set_toplevel(GNT_BOX(window), TRUE); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
207 gnt_box_set_title(GNT_BOX(window), _("Plugins")); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
208 gnt_box_set_pad(GNT_BOX(window), 0); |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
209 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
210 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
211 gnt_box_add_widget(GNT_BOX(window), |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
212 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
|
213 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new()); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
214 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
215 box = gnt_hbox_new(FALSE); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
216 gnt_box_add_widget(GNT_BOX(window), box); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
217 gnt_box_add_widget(GNT_BOX(window), gnt_hline_new()); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
218 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
219 gnt_box_set_pad(GNT_BOX(box), 0); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
220 plugins.tree = tree = gnt_tree_new(); |
14105
eaf7f35635bc
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14059
diff
changeset
|
221 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
|
222 GNT_WIDGET_SET_FLAGS(tree, GNT_WIDGET_NO_BORDER); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
223 gnt_box_add_widget(GNT_BOX(box), tree); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
224 gnt_box_add_widget(GNT_BOX(box), gnt_vline_new()); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
225 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
226 plugins.aboot = aboot = gnt_text_view_new(); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
227 gnt_widget_set_size(aboot, 40, 20); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
228 gnt_box_add_widget(GNT_BOX(box), aboot); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
229 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
230 for (iter = gaim_plugins_get_all(); iter; iter = iter->next) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
231 { |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
232 GaimPlugin *plug = iter->data; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
233 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
234 if (plug->info->type != GAIM_PLUGIN_STANDARD || |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
235 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE) || |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
236 plug->error) |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
237 continue; |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
238 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
239 gnt_tree_add_choice(GNT_TREE(tree), plug, |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
240 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
|
241 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
|
242 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
243 gnt_tree_set_col_width(GNT_TREE(tree), 0, 30); |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
244 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
|
245 g_signal_connect(G_OBJECT(tree), "selection_changed", G_CALLBACK(selection_changed), NULL); |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
246 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
247 box = gnt_hbox_new(FALSE); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
248 gnt_box_add_widget(GNT_BOX(window), box); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
249 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
250 button = gnt_button_new(_("Close")); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
251 gnt_box_add_widget(GNT_BOX(box), button); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
252 g_signal_connect_swapped(G_OBJECT(button), "activate", |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
253 G_CALLBACK(gnt_widget_destroy), window); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
254 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
255 plugins.conf = button = gnt_button_new(_("Configure Plugin")); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
256 gnt_box_add_widget(GNT_BOX(box), button); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
257 g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(configure_plugin_cb), NULL); |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
258 |
14024
7109e6397a31
[gaim-migrate @ 16622]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14010
diff
changeset
|
259 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
|
260 |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
261 gnt_widget_show(window); |
14139
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
262 |
44ec6c7cbc76
[gaim-migrate @ 16781]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
14105
diff
changeset
|
263 decide_conf_button(gnt_tree_get_selection_data(GNT_TREE(tree))); |
14010
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
264 } |
7573bd40a190
[gaim-migrate @ 16602]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff
changeset
|
265 |