Mercurial > pidgin.yaz
annotate src/prefs.c @ 5370:058230cccebb
[gaim-migrate @ 5746]
Adding some stuff here that is, er, a bit important.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 14 May 2003 05:53:48 +0000 |
parents | 1f901484599d |
children | c54cb8f8655f |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
1 | 5 * |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 | |
28 #include <sys/types.h> | |
29 #include <sys/stat.h> | |
30 | |
31 #include <unistd.h> | |
32 #include <stdio.h> | |
33 #include <stdlib.h> | |
970 | 34 #include <stdarg.h> |
3379 | 35 #include <ctype.h> |
1 | 36 #include <gtk/gtk.h> |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
1 | 38 #include "gaim.h" |
5228
1a53330dfd34
[gaim-migrate @ 5598]
Christian Hammond <chipx86@chipx86.com>
parents:
5211
diff
changeset
|
39 #include "gtkblist.h" |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
40 #include "gtkplugin.h" |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
41 #include "gtkdebug.h" |
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
42 #include "prpl.h" |
3366 | 43 #include "proxy.h" |
4561 | 44 #include "sound.h" |
3366 | 45 |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
46 #ifdef _WIN32 |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
47 #include "win32dep.h" |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
48 #endif |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
49 |
3567 | 50 GtkWidget *tree_v = NULL; |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
51 GtkWidget *prefs_away_menu = NULL; |
3366 | 52 GtkWidget *fontseld = NULL; |
53 | |
3379 | 54 GtkListStore *prefs_away_store = NULL; |
3366 | 55 |
56 static int sound_row_sel = 0; | |
57 static char *last_sound_dir = NULL; | |
58 | |
59 static GtkWidget *sounddialog = NULL; | |
60 static GtkWidget *browser_entry = NULL; | |
61 static GtkWidget *sound_entry = NULL; | |
62 static GtkWidget *away_text = NULL; | |
4324 | 63 static GtkListStore *smiley_theme_store = NULL; |
2254 | 64 GtkWidget *prefs_proxy_frame = NULL; |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
65 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
3427 | 66 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
3366 | 67 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
4428 | 68 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *); |
3366 | 69 static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
70 static void delete_prefs(GtkWidget *, void *); | |
71 void set_default_away(GtkWidget *, gpointer); | |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
72 #ifndef _WIN32 |
4428 | 73 static gboolean program_is_valid(const char *); |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
74 #endif |
1026 | 75 |
3565 | 76 GtkWidget *prefs = NULL; |
3366 | 77 GtkWidget *debugbutton = NULL; |
3565 | 78 static int notebook_page = 0; |
79 static GtkTreeIter plugin_iter; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
80 |
3630 | 81 /* |
82 * PROTOTYPES | |
83 */ | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
84 GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
85 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
86 static void update_plugin_list(void *data); |
3630 | 87 |
3366 | 88 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
89 GList *l; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
90 GaimPlugin *plug; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
91 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
92 gaim_plugins_unregister_probe_notify_cb(update_plugin_list); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
93 |
4064 | 94 save_prefs(); |
3485 | 95 prefs = NULL; |
3567 | 96 tree_v = NULL; |
3485 | 97 sound_entry = NULL; |
98 browser_entry = NULL; | |
3526 | 99 debugbutton = NULL; |
100 prefs_away_menu = NULL; | |
3565 | 101 notebook_page = 0; |
4324 | 102 smiley_theme_store = NULL; |
3485 | 103 if(sounddialog) |
3379 | 104 gtk_widget_destroy(sounddialog); |
3500 | 105 g_object_unref(G_OBJECT(prefs_away_store)); |
4635 | 106 prefs_away_store = NULL; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
107 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
108 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { |
4215 | 109 plug = l->data; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
110 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
111 if (GAIM_IS_GTK_PLUGIN(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
112 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
113 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
114 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
115 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
116 if (ui_info->iter != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
117 g_free(ui_info->iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
118 ui_info->iter = NULL; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
119 } |
4215 | 120 } |
121 } | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
122 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
123 |
3366 | 124 GtkWidget *preflabel; |
125 GtkWidget *prefsnotebook; | |
126 GtkTreeStore *prefstree; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
127 |
3818 | 128 static void set_misc_option(); |
129 static void set_logging_option(); | |
130 static void set_blist_option(); | |
131 static void set_convo_option(); | |
132 static void set_im_option(); | |
133 static void set_chat_option(); | |
134 static void set_font_option(); | |
135 static void set_sound_option(); | |
136 static void set_away_option(); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
137 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
138 #define PROXYHOST 0 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
139 #define PROXYPORT 1 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
140 #define PROXYTYPE 2 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
141 #define PROXYUSER 3 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
142 #define PROXYPASS 4 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
143 static void proxy_print_option(GtkEntry *entry, int entrynum) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
144 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
145 if (entrynum == PROXYHOST) |
4634 | 146 g_snprintf(global_proxy_info.proxyhost, sizeof(global_proxy_info.proxyhost), "%s", gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
147 else if (entrynum == PROXYPORT) |
4634 | 148 global_proxy_info.proxyport = atoi(gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
149 else if (entrynum == PROXYUSER) |
4634 | 150 g_snprintf(global_proxy_info.proxyuser, sizeof(global_proxy_info.proxyuser), "%s", gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
151 else if (entrynum == PROXYPASS) |
4634 | 152 g_snprintf(global_proxy_info.proxypass, sizeof(global_proxy_info.proxypass), "%s", gtk_entry_get_text(entry)); |
4137 | 153 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want |
154 to save it */ | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
155 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
156 |
3366 | 157 |
3565 | 158 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
3427 | 159 GtkWidget *vbox, *label, *hbox; |
160 char labeltext[256]; | |
3500 | 161 |
3427 | 162 vbox = gtk_vbox_new(FALSE, 6); |
163 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
164 label = gtk_label_new(NULL); | |
165 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
166 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
167 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
168 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
169 hbox = gtk_hbox_new(FALSE, 6); | |
170 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
171 label = gtk_label_new(" "); | |
172 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
173 vbox = gtk_vbox_new(FALSE, 6); | |
174 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
175 return vbox; | |
176 } | |
177 | |
3366 | 178 /* OK, Apply and Cancel */ |
179 | |
180 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
181 GtkTreeIter iter; | |
3427 | 182 char text[128]; |
3366 | 183 GValue val = { 0, }; |
184 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
3500 | 185 |
3366 | 186 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
187 return; | |
188 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3500 | 189 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
3427 | 190 g_value_get_string(&val)); |
191 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
3366 | 192 g_value_unset (&val); |
193 gtk_tree_model_get_value (model, &iter, 2, &val); | |
194 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
195 | |
196 } | |
197 | |
198 /* These are the pages in the preferences notebook */ | |
199 GtkWidget *interface_page() { | |
200 GtkWidget *ret; | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
201 GtkWidget *vbox; |
3427 | 202 ret = gtk_vbox_new(FALSE, 18); |
203 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 204 |
3427 | 205 vbox = make_frame(ret, _("Interface Options")); |
3500 | 206 |
4227 | 207 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
208 | |
3366 | 209 |
3427 | 210 gtk_widget_show_all(ret); |
3366 | 211 return ret; |
212 } | |
213 | |
4288 | 214 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { |
215 GtkTreeIter iter; | |
4298 | 216 const char *filename; |
4288 | 217 GValue val = { 0, }; |
218 | |
219 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
220 return; | |
221 gtk_tree_model_get_value (model, &iter, 2, &val); | |
222 filename = g_value_get_string(&val); | |
223 load_smiley_theme(filename, TRUE); | |
224 g_value_unset (&val); | |
4302 | 225 save_prefs(); |
4288 | 226 } |
227 | |
4324 | 228 GtkTreePath *theme_refresh_theme_list() |
229 { | |
230 GdkPixbuf *pixbuf; | |
4323 | 231 GSList *themes; |
4288 | 232 GtkTreeIter iter; |
4328 | 233 GtkTreePath *path = NULL; |
4325 | 234 int ind = 0; |
235 | |
4288 | 236 |
4323 | 237 smiley_theme_probe(); |
4328 | 238 |
4323 | 239 if (!smiley_themes) |
4328 | 240 return NULL; |
4325 | 241 |
4323 | 242 themes = smiley_themes; |
4325 | 243 |
244 gtk_list_store_clear(smiley_theme_store); | |
245 | |
4288 | 246 while (themes) { |
247 struct smiley_theme *theme = themes->data; | |
248 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
4718 | 249 "<span size='smaller' foreground='dim grey'>%s</span>", |
250 theme->name, theme->author, theme->desc); | |
4324 | 251 gtk_list_store_append (smiley_theme_store, &iter); |
4288 | 252 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); |
4328 | 253 |
4324 | 254 gtk_list_store_set(smiley_theme_store, &iter, |
4288 | 255 0, pixbuf, |
256 1, description, | |
257 2, theme->path, | |
258 -1); | |
4892 | 259 g_object_unref(G_OBJECT(pixbuf)); |
4288 | 260 g_free(description); |
261 themes = themes->next; | |
262 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
263 /* path = gtk_tree_path_new_from_indices(ind); */ | |
264 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
265 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
266 g_free(iwishihadgtk2_2); | |
267 } | |
268 ind++; | |
269 } | |
4325 | 270 |
4324 | 271 return path; |
272 } | |
4325 | 273 |
4326 | 274 void theme_install_theme(char *path, char *extn) { |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
275 #ifndef _WIN32 |
4325 | 276 gchar *command; |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
277 #endif |
4325 | 278 gchar *destdir; |
279 gchar *tail; | |
280 | |
281 /* Just to be safe */ | |
282 g_strchomp(path); | |
283 | |
284 /* I dont know what you are, get out of here */ | |
4326 | 285 if (extn != NULL) |
286 tail = extn; | |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
287 else if ((tail = strrchr(path, '.')) == NULL) |
4325 | 288 return; |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
289 |
4325 | 290 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); |
291 | |
292 /* We'll check this just to make sure. This also lets us do something different on | |
293 * other platforms, if need be */ | |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
294 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
295 #ifndef _WIN32 |
5014 | 296 command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
297 #else |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
298 if(!wgaim_gz_untar(path, destdir)) { |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
299 g_free(destdir); |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
300 return; |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
301 } |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
302 #endif |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
303 } |
4325 | 304 else { |
305 g_free(destdir); | |
306 return; | |
307 } | |
308 | |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
309 #ifndef _WIN32 |
4325 | 310 /* Fire! */ |
311 system(command); | |
312 | |
313 g_free(command); | |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
314 #endif |
4325 | 315 g_free(destdir); |
316 | |
317 theme_refresh_theme_list(); | |
318 } | |
319 | |
4326 | 320 static void theme_got_url(gpointer data, char *themedata, unsigned long len) { |
321 FILE *f; | |
322 gchar *path; | |
323 | |
324 f = gaim_mkstemp(&path); | |
325 fwrite(themedata, len, 1, f); | |
326 fclose(f); | |
327 | |
328 theme_install_theme(path, data); | |
329 | |
330 unlink(path); | |
331 g_free(path); | |
332 } | |
333 | |
4328 | 334 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, |
4325 | 335 guint info, guint t, gpointer data) { |
336 gchar *name = sd->data; | |
337 | |
338 if ((sd->length >= 0) && (sd->format == 8)) { | |
339 /* Well, it looks like the drag event was cool. | |
340 * Let's do something with it */ | |
341 | |
4793 | 342 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
343 GError *converr = NULL; |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
344 gchar *tmp; |
4325 | 345 /* It looks like we're dealing with a local file. Let's |
346 * just untar it in the right place */ | |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
347 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
348 gaim_debug(GAIM_DEBUG_ERROR, "theme dnd", "%s\n", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
349 (converr ? converr->message : |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
350 "g_filename_from_uri error")); |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
351 return; |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
352 } |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
353 theme_install_theme(tmp, NULL); |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
354 g_free(tmp); |
4793 | 355 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
4326 | 356 /* Oo, a web drag and drop. This is where things |
357 * will start to get interesting */ | |
358 gchar *tail; | |
4328 | 359 |
4326 | 360 if ((tail = strrchr(name, '.')) == NULL) |
361 return; | |
362 | |
363 /* We'll check this just to make sure. This also lets us do something different on | |
364 * other platforms, if need be */ | |
4332
c8f374cadbd9
[gaim-migrate @ 4596]
Christian Hammond <chipx86@chipx86.com>
parents:
4330
diff
changeset
|
365 grab_url(name, TRUE, theme_got_url, ".tgz"); |
4325 | 366 } |
367 | |
368 gtk_drag_finish(dc, TRUE, FALSE, t); | |
369 } | |
370 | |
371 gtk_drag_finish(dc, FALSE, FALSE, t); | |
372 } | |
373 | |
4324 | 374 GtkWidget *theme_page() { |
375 GtkWidget *ret; | |
376 GtkWidget *sw; | |
377 GtkWidget *view; | |
378 GtkCellRenderer *rend; | |
379 GtkTreeViewColumn *col; | |
380 GtkTreeSelection *sel; | |
381 GtkTreePath *path = NULL; | |
4334 | 382 GtkWidget *label; |
4702 | 383 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; |
4324 | 384 |
385 ret = gtk_vbox_new(FALSE, 18); | |
386 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
387 | |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
388 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below. New themes can be installed by dragging and dropping them onto the theme list.")); |
4334 | 389 |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
390 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
4334 | 391 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
392 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
393 | |
394 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
395 gtk_widget_show(label); | |
396 | |
4324 | 397 sw = gtk_scrolled_window_new(NULL,NULL); |
398 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
399 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
400 | |
401 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
402 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
403 | |
404 path = theme_refresh_theme_list(); | |
4288 | 405 |
4324 | 406 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
4325 | 407 |
408 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
409 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
410 | |
411 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
412 | |
4288 | 413 rend = gtk_cell_renderer_pixbuf_new(); |
414 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
4328 | 415 |
416 if(path) { | |
417 gtk_tree_selection_select_path(sel, path); | |
418 gtk_tree_path_free(path); | |
419 } | |
4288 | 420 |
4589 | 421 col = gtk_tree_view_column_new_with_attributes (_("Icon"), |
4288 | 422 rend, |
423 "pixbuf", 0, | |
424 NULL); | |
425 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
426 | |
427 rend = gtk_cell_renderer_text_new(); | |
4589 | 428 col = gtk_tree_view_column_new_with_attributes (_("Description"), |
4288 | 429 rend, |
430 "markup", 1, | |
431 NULL); | |
432 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
4324 | 433 g_object_unref(G_OBJECT(smiley_theme_store)); |
4288 | 434 gtk_container_add(GTK_CONTAINER(sw), view); |
435 | |
436 g_signal_connect (G_OBJECT (sel), "changed", | |
437 G_CALLBACK (smiley_sel), | |
438 NULL); | |
439 | |
440 | |
441 gtk_widget_show_all(ret); | |
442 return ret; | |
443 } | |
444 | |
3366 | 445 GtkWidget *font_page() { |
446 GtkWidget *ret; | |
447 GtkWidget *button; | |
448 GtkWidget *vbox, *hbox; | |
449 GtkWidget *select = NULL; | |
3427 | 450 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 451 |
3427 | 452 ret = gtk_vbox_new(FALSE, 18); |
453 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 454 |
3427 | 455 vbox = make_frame(ret, _("Style")); |
3818 | 456 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
457 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
458 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
4599 | 459 gaim_button(_("_Strikethrough"), &font_options, OPT_FONT_STRIKE, vbox); |
3500 | 460 |
3427 | 461 vbox = make_frame(ret, _("Face")); |
462 hbox = gtk_hbox_new(FALSE, 6); | |
463 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 464 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
3427 | 465 gtk_size_group_add_widget(sg, button); |
466 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
3366 | 467 |
3818 | 468 if (!(font_options & OPT_FONT_FACE)) |
3366 | 469 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
470 g_signal_connect(G_OBJECT(button), "clicked", |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
471 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
472 g_signal_connect(G_OBJECT(select), "clicked", |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
473 G_CALLBACK(show_font_dialog), NULL); |
3366 | 474 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
475 | |
476 hbox = gtk_hbox_new(FALSE, 5); | |
477 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 478 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
3427 | 479 gtk_size_group_add_widget(sg, button); |
3818 | 480 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
481 if (!(font_options & OPT_FONT_SIZE)) | |
3366 | 482 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
483 g_signal_connect(G_OBJECT(button), "clicked", |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
484 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 485 |
3500 | 486 vbox = make_frame(ret, _("Color")); |
3366 | 487 hbox = gtk_hbox_new(FALSE, 5); |
488 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 489 |
490 | |
3818 | 491 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
3427 | 492 gtk_size_group_add_widget(sg, button); |
493 | |
494 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
495 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 496 pref_fg_picture = show_color_pref(hbox, TRUE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
497 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 498 pref_fg_picture); |
3427 | 499 |
3818 | 500 if (!(font_options & OPT_FONT_FGCOL)) |
3366 | 501 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
502 g_signal_connect(G_OBJECT(button), "clicked", |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
503 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
504 g_signal_connect(G_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
3366 | 505 hbox = gtk_hbox_new(FALSE, 5); |
506 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 507 |
3818 | 508 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
3427 | 509 gtk_size_group_add_widget(sg, button); |
510 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
511 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 512 pref_bg_picture = show_color_pref(hbox, FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
513 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
514 G_CALLBACK(update_color), pref_bg_picture); |
3472 | 515 |
3818 | 516 if (!(font_options & OPT_FONT_BGCOL)) |
3366 | 517 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
518 g_signal_connect(G_OBJECT(select), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
519 G_CALLBACK(show_bgcolor_dialog), NULL); |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
520 g_signal_connect(G_OBJECT(button), "clicked", |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
521 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 522 |
3427 | 523 gtk_widget_show_all(ret); |
3366 | 524 return ret; |
525 } | |
526 | |
527 | |
528 GtkWidget *messages_page() { | |
529 GtkWidget *ret; | |
530 GtkWidget *vbox; | |
3427 | 531 ret = gtk_vbox_new(FALSE, 18); |
532 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 533 |
3427 | 534 vbox = make_frame (ret, _("Display")); |
3818 | 535 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
536 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
537 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
3803 | 538 #ifdef USE_GTKSPELL |
3818 | 539 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
3803 | 540 #endif |
3427 | 541 vbox = make_frame (ret, _("Ignore")); |
3818 | 542 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
543 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
544 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
3500 | 545 |
3427 | 546 gtk_widget_show_all(ret); |
3366 | 547 return ret; |
548 } | |
549 | |
550 GtkWidget *hotkeys_page() { | |
551 GtkWidget *ret; | |
552 GtkWidget *vbox; | |
3427 | 553 ret = gtk_vbox_new(FALSE, 18); |
554 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 555 |
3427 | 556 vbox = make_frame(ret, _("Send Message")); |
3818 | 557 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
558 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
3500 | 559 |
3427 | 560 vbox = make_frame (ret, _("Window Closing")); |
3818 | 561 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
562 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
3366 | 563 |
3427 | 564 vbox = make_frame(ret, "Insertions"); |
3818 | 565 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
566 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
567 |
3427 | 568 gtk_widget_show_all(ret); |
3366 | 569 return ret; |
570 } | |
571 | |
572 GtkWidget *list_page() { | |
573 GtkWidget *ret; | |
574 GtkWidget *vbox; | |
4985 | 575 GtkWidget *button, *b2; |
3427 | 576 ret = gtk_vbox_new(FALSE, 18); |
577 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 578 |
4956 | 579 vbox = make_frame (ret, _("Buddy List Toolbar")); |
4944 | 580 gaim_dropdown(vbox, _("Show _buttons as:"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, |
581 _("Pictures"), OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, | |
582 _("Text"), 0, | |
583 _("Pictures and text"), OPT_BLIST_SHOW_BUTTON_XPM, | |
584 _("None"), OPT_BLIST_NO_BUTTON_TEXT, NULL); | |
3366 | 585 |
3427 | 586 vbox = make_frame (ret, _("Buddy List Window")); |
4045 | 587 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); |
3366 | 588 |
4980 | 589 vbox = make_frame (ret, _("Group Display")); |
4700 | 590 /* gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); */ |
4980 | 591 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); |
3366 | 592 |
3427 | 593 vbox = make_frame (ret, _("Buddy Display")); |
4985 | 594 button = gaim_button(_("Show buddy _icons"), &blist_options, OPT_BLIST_SHOW_ICONS, vbox); |
595 b2 = gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
596 if (blist_options & OPT_BLIST_SHOW_ICONS) | |
597 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
598 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
599 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); |
4985 | 600 b2 = gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); |
601 if (blist_options & OPT_BLIST_SHOW_ICONS) | |
602 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
603 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
604 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); |
4944 | 605 gaim_button(_("Dim i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); |
3366 | 606 |
3427 | 607 gtk_widget_show_all(ret); |
3366 | 608 return ret; |
609 } | |
610 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
611 GtkWidget *conv_page() { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
612 GtkWidget *ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
613 GtkWidget *vbox; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
614 GtkWidget *label; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
615 GtkSizeGroup *sg; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
616 GList *names = NULL; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
617 int i; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
618 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
619 ret = gtk_vbox_new(FALSE, 18); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
620 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
621 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
622 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
623 vbox = make_frame(ret, _("Conversations")); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
624 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
625 /* Build a list of names. */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
626 for (i = 0; i < gaim_conv_placement_get_fnc_count(); i++) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
627 names = g_list_append(names, (char *)gaim_conv_placement_get_name(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
628 names = g_list_append(names, GINT_TO_POINTER(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
629 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
630 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
631 label = gaim_dropdown_from_list(vbox, _("_Placement:"), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
632 &conv_placement_option, -1, names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
633 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
634 g_list_free(names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
635 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
636 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
637 gtk_size_group_add_widget(sg, label); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
638 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
639 gaim_button(_("Show IMs and chats in _same tabbed window."), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
640 &convo_options, OPT_CONVO_COMBINE, vbox); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
641 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
642 gtk_widget_show_all(ret); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
643 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
644 return ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
645 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
646 |
3366 | 647 GtkWidget *im_page() { |
648 GtkWidget *ret; | |
3500 | 649 GtkWidget *vbox; |
3427 | 650 GtkWidget *typingbutton, *widge; |
651 GtkSizeGroup *sg; | |
3366 | 652 |
3427 | 653 ret = gtk_vbox_new(FALSE, 18); |
654 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
655 | |
656 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
657 | |
658 vbox = make_frame (ret, _("Window")); | |
4114 | 659 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
660 _("Pictures"), OPT_IM_BUTTON_XPM, | |
661 _("Text"), OPT_IM_BUTTON_TEXT, | |
662 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
3427 | 663 gtk_size_group_add_widget(sg, widge); |
664 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
3818 | 665 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
666 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
5281 | 667 gaim_labeled_spin_button(vbox, _("_Entry field height:"), &conv_size.entry_height, 25, 9999, sg); |
3818 | 668 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); |
669 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
3366 | 670 gtk_widget_show (vbox); |
671 | |
3427 | 672 vbox = make_frame (ret, _("Buddy Icons")); |
4045 | 673 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
674 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
3366 | 675 |
3427 | 676 vbox = make_frame (ret, _("Display")); |
3818 | 677 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
4991 | 678 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); |
3366 | 679 |
3427 | 680 vbox = make_frame (ret, _("Typing Notification")); |
3818 | 681 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
3366 | 682 OPT_MISC_STEALTH_TYPING, vbox); |
683 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
3818 | 684 misc_options ^= OPT_MISC_STEALTH_TYPING; |
3366 | 685 |
3427 | 686 gtk_widget_show_all(ret); |
3366 | 687 return ret; |
688 } | |
689 | |
690 GtkWidget *chat_page() { | |
691 GtkWidget *ret; | |
692 GtkWidget *vbox; | |
3427 | 693 GtkWidget *dd; |
694 GtkSizeGroup *sg; | |
3366 | 695 |
3427 | 696 ret = gtk_vbox_new(FALSE, 18); |
697 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 698 |
3427 | 699 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
3366 | 700 |
3427 | 701 vbox = make_frame (ret, _("Window")); |
4114 | 702 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
703 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
704 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
705 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
3427 | 706 gtk_size_group_add_widget(sg, dd); |
707 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
3818 | 708 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
709 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
5281 | 710 gaim_labeled_spin_button(vbox, _("_Entry field height:"), &buddy_chat_size.entry_height, 25, 9999, sg); |
3818 | 711 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); |
3366 | 712 |
3427 | 713 vbox = make_frame (ret, _("Tab Completion")); |
4045 | 714 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
715 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
3427 | 716 |
717 vbox = make_frame (ret, _("Display")); | |
3818 | 718 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
719 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
3427 | 720 |
721 gtk_widget_show_all(ret); | |
3366 | 722 return ret; |
723 } | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
724 |
3366 | 725 GtkWidget *tab_page() { |
726 GtkWidget *ret; | |
727 GtkWidget *vbox; | |
3427 | 728 GtkWidget *dd; |
4445 | 729 GtkWidget *button; |
3427 | 730 GtkSizeGroup *sg; |
731 ret = gtk_vbox_new(FALSE, 18); | |
732 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 733 |
3427 | 734 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 735 |
3427 | 736 vbox = make_frame (ret, _("IM Tabs")); |
4114 | 737 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
738 _("Top"), 0, | |
739 _("Bottom"), OPT_IM_BR_TAB, | |
740 _("Left"), OPT_IM_SIDE_TAB, | |
741 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
3427 | 742 gtk_size_group_add_widget(sg, dd); |
4045 | 743 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
4991 | 744 |
3366 | 745 |
3427 | 746 vbox = make_frame (ret, _("Chat Tabs")); |
4114 | 747 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
748 _("Top"), 0, | |
749 _("Bottom"), OPT_CHAT_BR_TAB, | |
750 _("Left"), OPT_CHAT_SIDE_TAB, | |
751 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
3427 | 752 gtk_size_group_add_widget(sg, dd); |
3818 | 753 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
3366 | 754 vbox); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
755 |
4445 | 756 vbox = make_frame (ret, _("Tab Options")); |
757 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); | |
4449 | 758 convo_options ^= OPT_CONVO_NO_X_ON_TAB; |
4445 | 759 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); |
760 | |
761 | |
3427 | 762 gtk_widget_show_all(ret); |
3366 | 763 return ret; |
764 } | |
765 | |
766 GtkWidget *proxy_page() { | |
767 GtkWidget *ret; | |
768 GtkWidget *vbox; | |
769 GtkWidget *entry; | |
770 GtkWidget *label; | |
771 GtkWidget *hbox; | |
772 GtkWidget *table; | |
773 | |
3427 | 774 ret = gtk_vbox_new(FALSE, 18); |
775 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 776 |
3427 | 777 vbox = make_frame (ret, _("Proxy Type")); |
4634 | 778 gaim_dropdown(vbox, _("Proxy _type:"), (int*)&global_proxy_info.proxytype, -1, |
4114 | 779 _("No proxy"), PROXY_NONE, |
3366 | 780 "SOCKS 4", PROXY_SOCKS4, |
781 "SOCKS 5", PROXY_SOCKS5, | |
782 "HTTP", PROXY_HTTP, NULL); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
783 |
3427 | 784 vbox = make_frame(ret, _("Proxy Server")); |
785 prefs_proxy_frame = vbox; | |
2254 | 786 |
4634 | 787 if (global_proxy_info.proxytype == PROXY_NONE) |
3427 | 788 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
2254 | 789 |
790 table = gtk_table_new(2, 4, FALSE); | |
791 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
792 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
793 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
3427 | 794 gtk_container_add(GTK_CONTAINER(vbox), table); |
2254 | 795 |
796 | |
3427 | 797 label = gtk_label_new_with_mnemonic(_("_Host")); |
2254 | 798 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
799 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
800 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
801 entry = gtk_entry_new(); |
3427 | 802 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 803 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
804 g_signal_connect(G_OBJECT(entry), "changed", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
805 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
4634 | 806 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyhost); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
807 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
808 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
809 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
810 |
3427 | 811 label = gtk_label_new_with_mnemonic(_("Port")); |
2254 | 812 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
813 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
814 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
815 entry = gtk_entry_new(); |
3427 | 816 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 817 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
818 g_signal_connect(G_OBJECT(entry), "changed", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
819 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
2254 | 820 |
4634 | 821 if (global_proxy_info.proxyport) { |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
822 char buf[128]; |
4634 | 823 g_snprintf(buf, sizeof(buf), "%d", global_proxy_info.proxyport); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
824 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
825 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
826 |
3427 | 827 label = gtk_label_new_with_mnemonic(_("_User")); |
2254 | 828 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
829 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
830 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
831 entry = gtk_entry_new(); |
3427 | 832 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 833 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
834 g_signal_connect(G_OBJECT(entry), "changed", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
835 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
4634 | 836 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyuser); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
837 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
838 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
839 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
840 |
3427 | 841 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
2254 | 842 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
843 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
844 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
845 entry = gtk_entry_new(); |
3427 | 846 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 847 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
848 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
849 g_signal_connect(G_OBJECT(entry), "changed", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
850 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
4634 | 851 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxypass); |
3500 | 852 |
3427 | 853 gtk_widget_show_all(ret); |
3366 | 854 return ret; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
855 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
856 |
3821 | 857 #ifndef _WIN32 |
4978 | 858 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { |
859 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
860 | |
4428 | 861 if (!program_is_valid(program)) { |
862 char *error = g_strdup_printf(_("The entered manual browser " | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
863 "'%s' is not valid. Hyperlinks will " |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
864 "not work."), program); |
4428 | 865 do_error_dialog(error, NULL, GAIM_WARNING); |
866 } | |
867 | |
868 g_strlcpy(web_command, program, sizeof(web_command)); | |
4978 | 869 |
870 /* carry on normally */ | |
871 return FALSE; | |
3432 | 872 } |
873 | |
4428 | 874 static GList *get_available_browsers() |
875 { | |
876 struct browser { | |
877 char *name; | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
878 char *command; |
4428 | 879 int id; |
880 }; | |
881 | |
882 static struct browser possible_browsers[] = { | |
883 {N_("Konqueror"), "kfmclient", BROWSER_KONQ}, | |
884 {N_("Opera"), "opera", BROWSER_OPERA}, | |
885 {N_("Galeon"), "galeon", BROWSER_GALEON}, | |
886 {N_("Netscape"), "netscape", BROWSER_NETSCAPE}, | |
887 {N_("Mozilla"), "mozilla", BROWSER_MOZILLA}, | |
888 }; | |
889 static const int num_possible_browsers = 5; | |
890 | |
891 GList *browsers = NULL; | |
892 int i = 0; | |
893 | |
894 browsers = g_list_prepend(browsers, GINT_TO_POINTER(BROWSER_MANUAL)); | |
895 browsers = g_list_prepend(browsers, _("Manual")); | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
896 for (i = 0; i < num_possible_browsers; i++) { |
4428 | 897 if (program_is_valid(possible_browsers[i].command)) { |
898 browsers = g_list_prepend(browsers, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
899 GINT_TO_POINTER(possible_browsers[i].id)); |
4428 | 900 browsers = g_list_prepend(browsers, possible_browsers[i].name); |
901 } | |
902 } | |
903 | |
904 return browsers; | |
905 } | |
906 | |
3366 | 907 GtkWidget *browser_page() { |
908 GtkWidget *ret; | |
3821 | 909 GtkWidget *vbox; |
910 GtkWidget *hbox; | |
3366 | 911 GtkWidget *label; |
3427 | 912 GtkSizeGroup *sg; |
4428 | 913 GList *browsers = NULL; |
3427 | 914 |
915 ret = gtk_vbox_new(FALSE, 18); | |
916 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
917 | |
918 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
919 vbox = make_frame (ret, _("Browser Selection")); | |
4428 | 920 |
921 browsers = get_available_browsers(); | |
922 if (browsers != NULL) { | |
923 label = gaim_dropdown_from_list(vbox,_("_Browser"), &web_browser, -1, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
924 browsers); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
925 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
926 gtk_size_group_add_widget(sg, label); |
4428 | 927 } |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
928 |
3366 | 929 hbox = gtk_hbox_new(FALSE, 5); |
930 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
4295 | 931 label = gtk_label_new_with_mnemonic(_("_Manual: ")); |
3366 | 932 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 933 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
934 gtk_size_group_add_widget(sg, label); | |
4978 | 935 |
3366 | 936 browser_entry = gtk_entry_new(); |
3427 | 937 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3818 | 938 if (web_browser != BROWSER_MANUAL) |
4428 | 939 gtk_widget_set_sensitive(hbox, FALSE); |
3366 | 940 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
941 |
3818 | 942 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
4978 | 943 g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", G_CALLBACK(manual_browser_set), NULL); |
4428 | 944 |
945 if (browsers != NULL) { | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
946 vbox = make_frame (ret, _("Browser Options")); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
947 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
4428 | 948 } |
4451
ce5b64fac95d
[gaim-migrate @ 4726]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4449
diff
changeset
|
949 |
3427 | 950 gtk_widget_show_all(ret); |
3366 | 951 return ret; |
3500 | 952 } |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
953 #endif /*_WIN32*/ |
3366 | 954 |
955 GtkWidget *logging_page() { | |
956 GtkWidget *ret; | |
957 GtkWidget *vbox; | |
3427 | 958 ret = gtk_vbox_new(FALSE, 18); |
959 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
960 |
3427 | 961 vbox = make_frame (ret, _("Message Logs")); |
4045 | 962 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
3818 | 963 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); |
964 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
965 |
3427 | 966 vbox = make_frame (ret, _("System Logs")); |
3818 | 967 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
3366 | 968 vbox); |
3818 | 969 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
3366 | 970 vbox); |
3818 | 971 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
972 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
3366 | 973 vbox); |
3818 | 974 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
3366 | 975 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
976 |
3427 | 977 gtk_widget_show_all(ret); |
3366 | 978 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
979 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
980 |
3366 | 981 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
982 |
3821 | 983 #ifndef _WIN32 |
4095 | 984 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
985 { |
4561 | 986 gaim_sound_set_command(gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
3366 | 987 return TRUE; |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
988 } |
3821 | 989 #endif |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
990 |
3366 | 991 GtkWidget *sound_page() { |
992 GtkWidget *ret; | |
3821 | 993 GtkWidget *vbox; |
994 GtkSizeGroup *sg; | |
995 #ifndef _WIN32 | |
996 GtkWidget *dd; | |
997 GtkWidget *hbox; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
998 GtkWidget *label; |
4561 | 999 char *cmd; |
3821 | 1000 #endif |
3366 | 1001 |
3427 | 1002 ret = gtk_vbox_new(FALSE, 18); |
1003 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1004 |
3427 | 1005 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1006 |
3427 | 1007 vbox = make_frame (ret, _("Sound Options")); |
3818 | 1008 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
1009 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1010 |
3630 | 1011 #ifndef _WIN32 |
3427 | 1012 vbox = make_frame (ret, _("Sound Method")); |
4114 | 1013 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
4581 | 1014 OPT_SOUND_ESD | OPT_SOUND_ARTS | OPT_SOUND_NAS | |
1015 OPT_SOUND_NORMAL | OPT_SOUND_CMD, | |
4114 | 1016 _("Console beep"), OPT_SOUND_BEEP, |
4561 | 1017 #ifdef USE_AO |
1018 _("Automatic"), OPT_SOUND_NORMAL, | |
4581 | 1019 "ESD", OPT_SOUND_ESD, |
1020 "Arts", OPT_SOUND_ARTS, | |
1021 #endif | |
1022 #ifdef USE_NAS_AUDIO | |
1023 "NAS", OPT_SOUND_NAS, | |
4082 | 1024 #endif |
4114 | 1025 _("Command"), OPT_SOUND_CMD, NULL); |
3427 | 1026 gtk_size_group_add_widget(sg, dd); |
1027 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1028 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1029 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1030 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 1031 |
3366 | 1032 hbox = gtk_hbox_new(FALSE, 5); |
1033 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 1034 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 1035 gtk_size_group_add_widget(sg, label); |
1036 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1037 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
1038 |
3366 | 1039 sndcmd = gtk_entry_new(); |
3427 | 1040 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1041 |
4635 | 1042 gtk_editable_set_editable(GTK_EDITABLE(sndcmd), TRUE); |
4561 | 1043 cmd = gaim_sound_get_command(); |
1044 if(cmd) | |
1045 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); | |
3366 | 1046 gtk_widget_set_size_request(sndcmd, 75, -1); |
3427 | 1047 |
3818 | 1048 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
3366 | 1049 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1050 g_signal_connect(G_OBJECT(sndcmd), "changed", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1051 G_CALLBACK(sound_cmd_yeah), NULL); |
3630 | 1052 #endif /* _WIN32 */ |
3427 | 1053 gtk_widget_show_all(ret); |
3366 | 1054 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1055 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1056 |
3366 | 1057 GtkWidget *away_page() { |
1058 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1059 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1060 GtkWidget *hbox; |
3366 | 1061 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1062 GtkWidget *button; |
3366 | 1063 GtkWidget *select; |
3427 | 1064 GtkWidget *dd; |
1065 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1066 |
3427 | 1067 ret = gtk_vbox_new(FALSE, 18); |
1068 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1069 |
3427 | 1070 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1071 |
3427 | 1072 vbox = make_frame (ret, _("Away")); |
3818 | 1073 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
1074 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1075 |
3427 | 1076 vbox = make_frame (ret, _("Auto-response")); |
3366 | 1077 hbox = gtk_hbox_new(FALSE, 0); |
1078 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 1079 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
3818 | 1080 &away_resend, 1, 24 * 60 * 60, sg); |
1081 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
1082 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
1083 gaim_button(_("Do_n't send auto-response in active conversations"), &away_options, OPT_AWAY_DELAY_IN_USE, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1084 |
3818 | 1085 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
3366 | 1086 gtk_widget_set_sensitive(hbox, FALSE); |
3500 | 1087 |
3427 | 1088 vbox = make_frame (ret, _("Idle")); |
4052 | 1089 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
1090 _("None"), IDLE_NONE, | |
1091 _("Gaim usage"), IDLE_GAIM, | |
3366 | 1092 #ifdef USE_SCREENSAVER |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1093 #ifndef _WIN32 |
4052 | 1094 _("X usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1095 #else |
4052 | 1096 _("Windows usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1097 #endif |
3366 | 1098 #endif |
3427 | 1099 NULL); |
1100 gtk_size_group_add_widget(sg, dd); | |
1101 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1102 |
3427 | 1103 vbox = make_frame (ret, _("Auto-away")); |
3818 | 1104 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
4052 | 1105 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
3818 | 1106 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1107 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1108 g_signal_connect(G_OBJECT(button), "clicked", |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1109 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
1 | 1110 |
4052 | 1111 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
3427 | 1112 gtk_size_group_add_widget(sg, label); |
1113 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1114 hbox = gtk_hbox_new(FALSE, 0); |
1115 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1116 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1117 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 1118 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3818 | 1119 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1120 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1121 g_signal_connect(G_OBJECT(button), "clicked", |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1122 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); |
3366 | 1123 default_away_menu_init(prefs_away_menu); |
1124 gtk_widget_show(prefs_away_menu); | |
1125 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
3500 | 1126 |
3427 | 1127 gtk_widget_show_all(ret); |
3366 | 1128 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1129 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1130 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1131 static GtkWidget *plugin_description=NULL, *plugin_details=NULL; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1132 |
3551 | 1133 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) |
1134 { | |
1135 gchar buf[1024]; | |
1136 GtkTreeIter iter; | |
1137 GValue val = { 0, }; | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1138 GaimPlugin *plug; |
3551 | 1139 |
1140 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1141 return; | |
1142 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1143 plug = g_value_get_pointer(&val); | |
1144 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1145 if (plug->error != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1146 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1147 "<span size=\"larger\">%s %s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1148 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1149 "%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1150 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1151 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1152 g_markup_escape_text(plug->error, -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1153 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1154 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1155 else { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1156 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1157 "<span size=\"larger\">%s %s</span>\n\n%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1158 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1159 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1160 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1161 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1162 |
3551 | 1163 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3630 | 1164 g_snprintf(buf, sizeof(buf), |
1165 #ifndef _WIN32 | |
1166 _("<span size=\"larger\">%s %s</span>\n\n" | |
1167 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
4617 | 1168 "<span weight=\"bold\">Web site:</span>\t\t%s\n" |
3630 | 1169 "<span weight=\"bold\">File name:</span>\t%s"), |
1170 #else | |
1171 _("<span size=\"larger\">%s %s</span>\n\n" | |
1172 "<span weight=\"bold\">Written by:</span> %s\n" | |
1173 "<span weight=\"bold\">URL:</span> %s\n" | |
1174 "<span weight=\"bold\">File name:</span> %s"), | |
1175 #endif | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1176 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1177 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1178 g_markup_escape_text(_(plug->info->author), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1179 g_markup_escape_text(plug->info->homepage, -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1180 plug->path); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1181 |
3551 | 1182 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); |
1183 g_value_unset (&val); | |
1184 } | |
1185 | |
1186 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1187 { | |
1188 GtkTreeModel *model = (GtkTreeModel *)data; | |
1189 GtkTreeIter iter; | |
1190 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1191 GaimPlugin *plug; |
3551 | 1192 gchar buf[1024]; |
3565 | 1193 |
3551 | 1194 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1195 gdk_window_set_cursor(prefs->window, wait); | |
1196 gdk_cursor_unref(wait); | |
1197 | |
1198 gtk_tree_model_get_iter (model, &iter, path); | |
1199 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
1200 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1201 if (!gaim_plugin_is_loaded(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1202 gaim_plugin_load(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1203 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1204 /* |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1205 * NOTE: This is basically the same check as before |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1206 * (plug->type == plugin), but now there aren't plugin types. |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1207 * Not yet, anyway. I want to do a V2 of the plugin API. |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1208 * The thing is, we should have a flag specifying the UI type, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1209 * or just whether it's a general plugin or a UI-specific |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1210 * plugin. We should only load this if it's UI-specific. |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1211 * |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1212 * -- ChipX86 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1213 */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1214 if (GAIM_IS_GTK_PLUGIN(plug)) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1215 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1216 GtkWidget *config_frame; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1217 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1218 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1219 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1220 config_frame = gaim_gtk_plugin_get_config_frame(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1221 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1222 if (config_frame != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1223 ui_info->iter = g_new0(GtkTreeIter, 1); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1224 prefs_notebook_add_page(_(plug->info->name), NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1225 config_frame, ui_info->iter, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1226 &plugin_iter, notebook_page++); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1227 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1228 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1229 &plugin_iter) == 1) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1230 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1231 /* Expand the tree for the first plugin added */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1232 GtkTreePath *path2; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1233 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1234 path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1235 &plugin_iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1236 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1237 path2, TRUE); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1238 gtk_tree_path_free(path2); |
3565 | 1239 } |
1240 } | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1241 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1242 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1243 else { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1244 if (GAIM_IS_GTK_PLUGIN(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1245 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1246 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1247 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1248 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1249 if (ui_info != NULL && ui_info->iter != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1250 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), ui_info->iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1251 g_free(ui_info->iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1252 ui_info->iter = NULL; |
3565 | 1253 } |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1254 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1255 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1256 gaim_plugin_unload(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1257 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1258 |
3551 | 1259 gdk_window_set_cursor(prefs->window, NULL); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1260 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1261 if (plug->error != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1262 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1263 "<span size=\"larger\">%s %s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1264 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1265 "%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1266 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1267 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1268 g_markup_escape_text(plug->error, -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1269 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1270 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1271 else { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1272 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1273 "<span size=\"larger\">%s %s</span>\n\n%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1274 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1275 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1276 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1277 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1278 |
3563 | 1279 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1280 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1281 gaim_plugin_is_loaded(plug), -1); |
3563 | 1282 |
3551 | 1283 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1284 gtk_tree_path_free(path); | |
1285 } | |
1286 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1287 static void |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1288 update_plugin_list(void *data) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1289 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1290 GtkListStore *ls = GTK_LIST_STORE(data); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1291 GtkTreeIter iter; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1292 GList *probes; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1293 GaimPlugin *plug; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1294 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1295 gtk_list_store_clear(ls); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1296 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1297 for (probes = gaim_plugins_get_all(); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1298 probes != NULL; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1299 probes = probes->next) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1300 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1301 plug = probes->data; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1302 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1303 if (plug->info->type != GAIM_PLUGIN_STANDARD) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1304 continue; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1305 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1306 gtk_list_store_append (ls, &iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1307 gtk_list_store_set(ls, &iter, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1308 0, gaim_plugin_is_loaded(plug), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1309 1, plug->info->name ? _(plug->info->name) : plug->path, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1310 2, plug, -1); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1311 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1312 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1313 |
3551 | 1314 static GtkWidget *plugin_page () |
1315 { | |
1316 GtkWidget *ret; | |
1317 GtkWidget *sw, *vp; | |
1318 GtkWidget *event_view; | |
1319 GtkListStore *ls; | |
1320 GtkCellRenderer *rend, *rendt; | |
1321 GtkTreeViewColumn *col; | |
1322 GtkTreeSelection *sel; | |
1323 GtkTreePath *path; | |
1324 GtkWidget *nb; | |
1325 | |
1326 ret = gtk_vbox_new(FALSE, 18); | |
1327 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1328 | |
1329 sw = gtk_scrolled_window_new(NULL,NULL); | |
1330 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1331 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1332 | |
1333 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1334 | |
1335 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1336 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1337 update_plugin_list(ls); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1338 |
3551 | 1339 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); |
1340 | |
1341 rend = gtk_cell_renderer_toggle_new(); | |
1342 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1343 | |
1344 | |
4295 | 1345 col = gtk_tree_view_column_new_with_attributes (_("Load"), |
3551 | 1346 rend, |
1347 "active", 0, | |
1348 NULL); | |
1349 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1350 | |
1351 rendt = gtk_cell_renderer_text_new(); | |
4295 | 1352 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
3551 | 1353 rendt, |
1354 "text", 1, | |
1355 NULL); | |
1356 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1357 g_object_unref(G_OBJECT(ls)); | |
1358 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1359 | |
1360 | |
1361 nb = gtk_notebook_new(); | |
1362 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1363 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1364 | |
1365 /* Description */ | |
1366 sw = gtk_scrolled_window_new(NULL, NULL); | |
1367 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1368 plugin_description = gtk_label_new(NULL); | |
1369 | |
1370 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1371 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1372 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1373 | |
3630 | 1374 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
1375 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1376 |
3630 | 1377 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
1378 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
3551 | 1379 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
1380 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1381 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1382 | |
1383 /* Details */ | |
1384 sw = gtk_scrolled_window_new(NULL, NULL); | |
1385 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1386 plugin_details = gtk_label_new(NULL); | |
1387 | |
1388 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1389 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1390 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1391 | |
3630 | 1392 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
1393 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1394 |
3630 | 1395 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
1396 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
3551 | 1397 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
1398 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1399 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1400 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1401 | |
1402 g_signal_connect (G_OBJECT (sel), "changed", | |
1403 G_CALLBACK (prefs_plugin_sel), | |
1404 NULL); | |
1405 g_signal_connect (G_OBJECT(rend), "toggled", | |
1406 G_CALLBACK(plugin_load), ls); | |
1407 | |
1408 path = gtk_tree_path_new_first(); | |
1409 gtk_tree_selection_select_path(sel, path); | |
1410 gtk_tree_path_free(path); | |
1411 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1412 gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1413 |
3551 | 1414 gtk_widget_show_all(ret); |
1415 return ret; | |
1416 } | |
1417 | |
3366 | 1418 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1419 { |
3366 | 1420 GtkTreeModel *model = (GtkTreeModel *)data; |
1421 GtkTreeIter iter; | |
1422 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
3500 | 1423 gint soundnum; |
3366 | 1424 |
1425 gtk_tree_model_get_iter (model, &iter, path); | |
1426 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1427 |
4561 | 1428 sound_options ^= gaim_sound_get_event_option(soundnum); |
1429 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & gaim_sound_get_event_option(soundnum), -1); | |
3522 | 1430 |
1431 gtk_tree_path_free(path); | |
3366 | 1432 } |
1433 | |
1434 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1435 { | |
1436 guint32 tmp_sound = sound_options; | |
1437 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
1438 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
4561 | 1439 if (!(sound_options & gaim_sound_get_event_option(sound_row_sel))) |
1440 sound_options ^= gaim_sound_get_event_option(sound_row_sel); | |
1441 gaim_sound_play_event(sound_row_sel); | |
3500 | 1442 |
3366 | 1443 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1444 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1445 |
3366 | 1446 static void reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1447 { |
3366 | 1448 /* This just resets a sound file back to default */ |
4561 | 1449 gaim_sound_set_event_file(sound_row_sel, NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1450 |
3366 | 1451 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1452 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1453 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1454 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 1455 { |
1456 | |
1457 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1458 |
1170 | 1459 if (!GTK_IS_WIDGET(w2)) |
1460 dest = w; | |
1461 else | |
1462 dest = w2; | |
1463 | |
1464 sounddialog = NULL; | |
1465 | |
1466 gtk_widget_destroy(dest); | |
1467 } | |
1468 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1469 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1470 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1471 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1472 |
1170 | 1473 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
1474 | |
1475 /* If they type in a directory, change there */ | |
1476 if (file_is_dir(file, sounddialog)) | |
1477 return; | |
1478 | |
1479 /* Set it -- and forget it */ | |
4561 | 1480 gaim_sound_set_event_file(snd, file); |
3500 | 1481 |
1175 | 1482 /* Set our text entry */ |
4561 | 1483 gtk_entry_set_text(GTK_ENTRY(sound_entry), file); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1484 |
1170 | 1485 /* Close the window! It's getting cold in here! */ |
1486 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1487 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1488 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1489 g_free(last_sound_dir); |
4793 | 1490 last_sound_dir = g_path_get_dirname(file); |
1170 | 1491 } |
1492 | |
3366 | 1493 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1494 { |
1170 | 1495 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1496 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1497 if (!sounddialog) { |
4703 | 1498 sounddialog = gtk_file_selection_new(_("Sound Selection")); |
1170 | 1499 |
1500 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1501 | |
3630 | 1502 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
1170 | 1503 |
1504 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1505 | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1506 g_signal_connect(G_OBJECT(sounddialog), "destroy", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1507 G_CALLBACK(close_sounddialog), sounddialog); |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1508 |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1509 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1510 "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1511 G_CALLBACK(do_select_sound), (int *)sound_row_sel); |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1512 |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1513 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1514 "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1515 G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1516 } |
1517 | |
1518 g_free(buf); | |
1519 gtk_widget_show(sounddialog); | |
1520 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1521 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1522 |
3366 | 1523 |
1524 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1525 GtkTreeIter iter; | |
1526 GValue val = { 0, }; | |
4561 | 1527 char *file; |
3500 | 1528 |
3366 | 1529 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1530 return; | |
1531 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1532 sound_row_sel = g_value_get_uint(&val); | |
4561 | 1533 file = gaim_sound_get_event_file(sound_row_sel); |
3366 | 1534 if (sound_entry) |
4561 | 1535 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); |
3366 | 1536 g_value_unset (&val); |
1537 if (sounddialog) | |
1538 gtk_widget_destroy(sounddialog); | |
1539 } | |
1540 | |
1541 GtkWidget *sound_events_page() { | |
1542 | |
1543 GtkWidget *ret; | |
1544 GtkWidget *sw; | |
1545 GtkWidget *button, *hbox; | |
1546 GtkTreeIter iter; | |
1547 GtkWidget *event_view; | |
1548 GtkListStore *event_store; | |
1549 GtkCellRenderer *rend; | |
1550 GtkTreeViewColumn *col; | |
1551 GtkTreeSelection *sel; | |
1552 GtkTreePath *path; | |
1553 int j; | |
4561 | 1554 char *file; |
3366 | 1555 |
3427 | 1556 ret = gtk_vbox_new(FALSE, 18); |
1557 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 1558 |
1559 sw = gtk_scrolled_window_new(NULL,NULL); | |
1560 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3814 | 1561 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1562 | |
3427 | 1563 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1564 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
1565 | |
4561 | 1566 for (j=0; j < GAIM_NUM_SOUNDS; j++) { |
1567 guint opt = gaim_sound_get_event_option(j); | |
1568 if (opt == 0) | |
3366 | 1569 continue; |
3500 | 1570 |
3366 | 1571 gtk_list_store_append (event_store, &iter); |
1572 gtk_list_store_set(event_store, &iter, | |
4561 | 1573 0, sound_options & opt, |
1574 1, gettext(gaim_sound_get_event_label(j)), | |
3366 | 1575 2, j, -1); |
1576 } | |
1577 | |
1578 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
3500 | 1579 |
3366 | 1580 rend = gtk_cell_renderer_toggle_new(); |
1581 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1582 g_signal_connect (G_OBJECT (sel), "changed", | |
1583 G_CALLBACK (prefs_sound_sel), | |
1584 NULL); | |
1585 g_signal_connect (G_OBJECT(rend), "toggled", | |
1586 G_CALLBACK(event_toggled), event_store); | |
1587 path = gtk_tree_path_new_first(); | |
1588 gtk_tree_selection_select_path(sel, path); | |
3522 | 1589 gtk_tree_path_free(path); |
3500 | 1590 |
4295 | 1591 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
3366 | 1592 rend, |
1593 "active", 0, | |
1594 NULL); | |
1595 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1596 | |
1597 rend = gtk_cell_renderer_text_new(); | |
4295 | 1598 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
3366 | 1599 rend, |
1600 "text", 1, | |
1601 NULL); | |
1602 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
3500 | 1603 g_object_unref(G_OBJECT(event_store)); |
3366 | 1604 gtk_container_add(GTK_CONTAINER(sw), event_view); |
1605 | |
3427 | 1606 hbox = gtk_hbox_new(FALSE, 6); |
1607 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1608 sound_entry = gtk_entry_new(); |
4561 | 1609 file = gaim_sound_get_event_file(0); |
1610 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); | |
4635 | 1611 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
3366 | 1612 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1613 |
3025 | 1614 button = gtk_button_new_with_label(_("Test")); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1615 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
3366 | 1616 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
2759
f26f1d139615
[gaim-migrate @ 2772]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2746
diff
changeset
|
1617 |
1175 | 1618 button = gtk_button_new_with_label(_("Reset")); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1619 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
3366 | 1620 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
1175 | 1621 |
1381 | 1622 button = gtk_button_new_with_label(_("Choose...")); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1623 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); |
3366 | 1624 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
3500 | 1625 |
3427 | 1626 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1627 |
3366 | 1628 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1629 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1630 |
3366 | 1631 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1632 { |
3366 | 1633 GtkTreeIter iter; |
1634 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1635 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1636 char *tmp; |
3374 | 1637 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1638 |
3366 | 1639 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1640 return; | |
1641 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1642 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1643 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1644 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1645 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1646 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1647 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1648 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1649 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1650 g_free(tmp); |
3366 | 1651 g_value_unset (&val); |
3500 | 1652 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1653 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1654 |
3500 | 1655 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
3366 | 1656 struct away_message *am; |
1657 GtkTreeIter iter; | |
1658 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1659 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1660 GValue val = { 0, }; |
3500 | 1661 |
3379 | 1662 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1663 return; |
3379 | 1664 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1665 am = g_value_get_pointer (&val); |
1666 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1667 rem_away_mess(NULL, am); | |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1668 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1669 |
3366 | 1670 GtkWidget *away_message_page() { |
1671 GtkWidget *ret; | |
3427 | 1672 GtkWidget *hbox; |
3379 | 1673 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1674 GtkWidget *sw; |
3366 | 1675 GtkTreeIter iter; |
1676 GtkWidget *event_view; | |
1677 GtkCellRenderer *rend; | |
1678 GtkTreeViewColumn *col; | |
1679 GtkTreeSelection *sel; | |
940 | 1680 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1681 struct away_message *a; |
3366 | 1682 GtkWidget *sw2; |
3427 | 1683 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1684 |
3427 | 1685 ret = gtk_vbox_new(FALSE, 18); |
1686 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1687 | |
1688 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
3500 | 1689 |
3366 | 1690 sw = gtk_scrolled_window_new(NULL,NULL); |
1691 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1692 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3817 | 1693 /* |
1694 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1695 */ | |
3427 | 1696 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3500 | 1697 |
3374 | 1698 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1699 while (awy) { |
1700 a = (struct away_message *)awy->data; | |
1701 gtk_list_store_append (prefs_away_store, &iter); | |
1702 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1703 0, a->name, |
1704 1, a, -1); | |
3366 | 1705 awy = awy->next; |
1706 } | |
1707 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1708 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1709 |
3366 | 1710 rend = gtk_cell_renderer_text_new(); |
1711 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1712 rend, | |
1713 "text", 0, | |
1714 NULL); | |
1715 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1716 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1717 gtk_widget_show(event_view); | |
3427 | 1718 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1719 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1720 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1721 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1722 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1723 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3500 | 1724 |
3427 | 1725 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1726 gaim_setup_imhtml(away_text); |
3366 | 1727 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
1728 g_signal_connect (G_OBJECT (sel), "changed", | |
1729 G_CALLBACK (away_message_sel), | |
1730 NULL); | |
1731 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1732 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1733 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1734 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1735 gtk_size_group_add_widget(sg, button); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1736 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1737 G_CALLBACK(create_away_mess), NULL); |
3472 | 1738 |
3366 | 1739 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1740 gtk_size_group_add_widget(sg, button); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1741 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1742 G_CALLBACK(remove_away_message), event_view); |
3472 | 1743 |
3366 | 1744 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1745 |
5024 | 1746 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); |
3427 | 1747 gtk_size_group_add_widget(sg, button); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1748 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1749 G_CALLBACK(create_away_mess), event_view); |
3366 | 1750 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1751 |
3427 | 1752 gtk_widget_show_all(ret); |
3366 | 1753 return ret; |
1754 } | |
3472 | 1755 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1756 GtkTreeIter *prefs_notebook_add_page(const char *text, |
3500 | 1757 GdkPixbuf *pixbuf, |
1758 GtkWidget *page, | |
3366 | 1759 GtkTreeIter *iter, |
3500 | 1760 GtkTreeIter *parent, |
3366 | 1761 int ind) { |
1762 GdkPixbuf *icon = NULL; | |
3500 | 1763 |
3366 | 1764 if (pixbuf) |
3500 | 1765 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1766 |
3366 | 1767 gtk_tree_store_append (prefstree, iter, parent); |
1768 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1769 |
3366 | 1770 if (pixbuf) |
1771 g_object_unref(pixbuf); | |
1772 if (icon) | |
1773 g_object_unref(icon); | |
1774 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1775 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1776 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1777 |
3366 | 1778 void prefs_notebook_init() { |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1779 GtkTreeIter p, p2, c; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1780 GList *l; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1781 GaimPlugin *plug; |
3565 | 1782 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); |
4620 | 1783 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); |
3565 | 1784 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
1785 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1786 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1787 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
4488 | 1788 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1789 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1790 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1791 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p2, notebook_page++); |
3565 | 1792 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1793 #ifndef _WIN32 |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1794 /* We use the registered default browser in windows */ |
3565 | 1795 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1796 #endif |
3565 | 1797 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
1798 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1799 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1800 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1801 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1802 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1803 if (gaim_plugins_enabled()) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1804 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1805 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1806 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1807 plug = l->data; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1808 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1809 if (GAIM_IS_GTK_PLUGIN(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1810 GtkWidget *config_frame; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1811 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1812 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1813 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1814 config_frame = gaim_gtk_plugin_get_config_frame(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1815 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1816 if (config_frame != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1817 ui_info->iter = g_new0(GtkTreeIter, 1); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1818 prefs_notebook_add_page(_(plug->info->name), NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1819 config_frame, ui_info->iter, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1820 &plugin_iter, notebook_page++); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1821 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1822 } |
3565 | 1823 } |
1824 } | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1825 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1826 |
3500 | 1827 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1828 { |
3366 | 1829 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1830 GtkWidget *hbox; |
3366 | 1831 GtkWidget *frame; |
1832 GtkTreeViewColumn *column; | |
1833 GtkCellRenderer *cell; | |
1834 GtkTreeSelection *sel; | |
1835 GtkWidget *notebook; | |
1836 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1837 GtkWidget *button; |
3515 | 1838 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
3500 | 1839 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1840 if (prefs) { |
3472 | 1841 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1842 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1843 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1844 |
3366 | 1845 /* copy the preferences to tmp values... |
1846 * I liked "take affect immediately" Oh well :-( */ | |
3818 | 1847 |
1848 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
3500 | 1849 |
3366 | 1850 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1851 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4074 | 1852 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1853 gtk_widget_realize(prefs); |
4703 | 1854 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); |
4635 | 1855 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1856 g_signal_connect(G_OBJECT(prefs), "destroy", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1857 G_CALLBACK(delete_prefs), NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1858 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1859 vbox = gtk_vbox_new(FALSE, 5); |
4635 | 1860 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1861 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1862 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1863 |
3366 | 1864 hbox = gtk_hbox_new (FALSE, 6); |
1865 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1866 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1867 gtk_widget_show (hbox); | |
1868 | |
1869 frame = gtk_frame_new (NULL); | |
1870 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1871 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1872 gtk_widget_show (frame); | |
3500 | 1873 |
3366 | 1874 /* The tree -- much inspired by the Gimp */ |
1875 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1876 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1877 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1878 | |
1879 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1880 gtk_widget_show(tree_v); | |
1881 /* icons */ | |
4892 | 1882 /* XXX: to be used at a later date |
3366 | 1883 cell = gtk_cell_renderer_pixbuf_new (); |
1884 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
4892 | 1885 */ |
3500 | 1886 |
3366 | 1887 /* text */ |
1888 cell = gtk_cell_renderer_text_new (); | |
1889 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1890 |
3366 | 1891 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1892 |
3472 | 1893 /* The right side */ |
1894 frame = gtk_frame_new (NULL); | |
1895 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1896 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1897 gtk_widget_show (frame); | |
3500 | 1898 |
3472 | 1899 vbox2 = gtk_vbox_new (FALSE, 4); |
1900 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1901 gtk_widget_show (vbox2); | |
3500 | 1902 |
3472 | 1903 frame = gtk_frame_new (NULL); |
1904 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1905 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1906 gtk_widget_show (frame); | |
3500 | 1907 |
3472 | 1908 hbox = gtk_hbox_new (FALSE, 4); |
1909 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1910 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1911 gtk_widget_show (hbox); | |
3500 | 1912 |
3472 | 1913 preflabel = gtk_label_new(NULL); |
1914 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1915 gtk_widget_show (preflabel); | |
3500 | 1916 |
3472 | 1917 /* The notebook */ |
1918 prefsnotebook = notebook = gtk_notebook_new (); | |
1919 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1920 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1921 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1922 |
3472 | 1923 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1924 g_signal_connect (G_OBJECT (sel), "changed", | |
1925 G_CALLBACK (pref_nb_select), | |
1926 notebook); | |
3500 | 1927 gtk_widget_show(notebook); |
3472 | 1928 sep = gtk_hseparator_new(); |
1929 gtk_widget_show(sep); | |
1930 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1931 |
3818 | 1932 /* The buttons^H to press! */ |
3472 | 1933 hbox = gtk_hbox_new (FALSE, 6); |
1934 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1935 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1936 gtk_widget_show (hbox); |
3377 | 1937 |
3818 | 1938 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
3515 | 1939 gtk_size_group_add_widget(sg, button); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1940 g_signal_connect_swapped(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
1941 G_CALLBACK(gtk_widget_destroy), prefs); |
3515 | 1942 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1943 gtk_widget_show(button); | |
1944 | |
3500 | 1945 prefs_notebook_init(); |
3427 | 1946 |
3472 | 1947 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1948 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1949 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1950 |
1 | 1951 void set_option(GtkWidget *w, int *option) |
1952 { | |
1953 *option = !(*option); | |
1954 } | |
1955 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1956 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1957 { |
3818 | 1958 misc_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1959 |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1960 if (option == OPT_MISC_DEBUG) { |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1961 if ((misc_options & OPT_MISC_DEBUG)) |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1962 gaim_gtk_debug_window_show(); |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1963 else |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1964 gaim_gtk_debug_window_hide(); |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1965 } |
4227 | 1966 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
4687 | 1967 /* XXX blist reset the aliases here */ |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1968 gaim_conversation_foreach(gaim_conversation_autoset_title); |
4227 | 1969 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1970 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1971 |
3818 | 1972 static void set_logging_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1973 { |
3818 | 1974 logging_options ^= option; |
3500 | 1975 |
3818 | 1976 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
1977 update_log_convs(); | |
3366 | 1978 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1979 |
3818 | 1980 static void set_blist_option(GtkWidget *w, int option) |
3366 | 1981 { |
4695
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1982 struct gaim_gtk_buddy_list *gtkblist; |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1983 |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1984 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1985 |
3818 | 1986 blist_options ^= option; |
5297 | 1987 |
4687 | 1988 if (!gtkblist) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1989 return; |
5297 | 1990 |
1991 if (option == OPT_BLIST_SHOW_WARN) | |
4725 | 1992 gaim_gtk_blist_update_columns(); |
5297 | 1993 else if (option == OPT_BLIST_SHOW_IDLETIME) { |
1994 gaim_gtk_blist_update_refresh_timeout(); | |
1995 gaim_gtk_blist_update_columns(); | |
1996 } | |
4725 | 1997 else if (option == OPT_BLIST_SHOW_ICONS) { |
5297 | 1998 gaim_gtk_blist_update_refresh_timeout(); |
4697 | 1999 gaim_gtk_blist_refresh(gaim_get_blist()); |
4725 | 2000 gaim_gtk_blist_update_columns(); |
2001 } else | |
2002 gaim_gtk_blist_refresh(gaim_get_blist()); | |
5297 | 2003 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2004 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2005 |
3818 | 2006 static void set_convo_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2007 { |
3818 | 2008 convo_options ^= option; |
3500 | 2009 |
3818 | 2010 if (option == OPT_CONVO_SHOW_SMILEY) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2011 gaim_gtkconv_toggle_smileys(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2012 |
3818 | 2013 if (option == OPT_CONVO_SHOW_TIME) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2014 gaim_gtkconv_toggle_timestamps(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2015 |
3818 | 2016 if (option == OPT_CONVO_CHECK_SPELLING) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2017 gaim_gtkconv_toggle_spellchk(); |
4445 | 2018 |
2019 if (option == OPT_CONVO_NO_X_ON_TAB) | |
2020 gaim_gtkconv_toggle_close_buttons(); | |
3818 | 2021 } |
2022 | |
2023 static void set_im_option(GtkWidget *w, int option) | |
2024 { | |
2025 im_options ^= option; | |
3500 | 2026 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2027 #if 0 |
3818 | 2028 if (option == OPT_IM_ONE_WINDOW) |
2029 im_tabize(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2030 #endif |
3818 | 2031 |
2032 if (option == OPT_IM_HIDE_ICONS) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2033 gaim_gtkconv_hide_buddy_icons(); |
3818 | 2034 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2035 if (option == OPT_IM_ALIAS_TAB) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2036 gaim_conversation_foreach(gaim_conversation_autoset_title); |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2037 |
3818 | 2038 if (option == OPT_IM_NO_ANIMATION) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2039 gaim_gtkconv_set_anim(); |
1 | 2040 } |
2041 | |
3818 | 2042 static void set_chat_option(GtkWidget *w, int option) |
1 | 2043 { |
3818 | 2044 chat_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2045 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2046 #if 0 |
3818 | 2047 if (option == OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2048 chat_tabize(); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2049 #endif |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2050 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2051 |
3818 | 2052 void set_sound_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2053 { |
3818 | 2054 sound_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2055 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2056 |
3818 | 2057 static void set_font_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2058 { |
3818 | 2059 font_options ^= option; |
3500 | 2060 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2061 gaim_gtkconv_update_font_buttons(); |
1 | 2062 } |
2063 | |
3818 | 2064 static void set_away_option(GtkWidget *w, int option) |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2065 { |
3818 | 2066 away_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2067 |
3818 | 2068 if (option == OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2069 toggle_away_queue(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2070 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2071 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2072 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 2073 { |
2074 GtkWidget *button; | |
3427 | 2075 button = gtk_check_button_new_with_mnemonic(text); |
4635 | 2076 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option)); |
1 | 2077 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
4635 | 2078 g_object_set_data(G_OBJECT(button), "options", options); |
1 | 2079 |
4064 | 2080 if (options == &misc_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2081 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2082 G_CALLBACK(set_misc_option), (int *)option); |
4064 | 2083 } else if (options == &logging_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2084 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2085 G_CALLBACK(set_logging_option), (int *)option); |
4064 | 2086 } else if (options == &blist_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2087 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2088 G_CALLBACK(set_blist_option), (int *)option); |
4064 | 2089 } else if (options == &convo_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2090 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2091 G_CALLBACK(set_convo_option), (int *)option); |
4064 | 2092 } else if (options == &im_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2093 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2094 G_CALLBACK(set_im_option), (int *)option); |
4064 | 2095 } else if (options == &chat_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2096 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2097 G_CALLBACK(set_chat_option), (int *)option); |
4064 | 2098 } else if (options == &font_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2099 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2100 G_CALLBACK(set_font_option), (int *)option); |
4064 | 2101 } else if (options == &sound_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2102 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2103 G_CALLBACK(set_sound_option), (int *)option); |
4064 | 2104 } else if (options == &away_options) { |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2105 g_signal_connect(G_OBJECT(button), "clicked", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2106 G_CALLBACK(set_away_option), (int *)option); |
4064 | 2107 } else { |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2108 gaim_debug(GAIM_DEBUG_WARNING, "gaim_button", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2109 "\"%s\" has no signal handler attached to it!\n", text); |
4064 | 2110 } |
1 | 2111 gtk_widget_show(button); |
2112 | |
2113 return button; | |
2114 } | |
2115 | |
3366 | 2116 void default_away_menu_init(GtkWidget *omenu) |
3032 | 2117 { |
3366 | 2118 GtkWidget *menu, *opt; |
2119 int index = 0; | |
2120 GSList *awy = away_messages; | |
2121 struct away_message *a; | |
2122 | |
2123 menu = gtk_menu_new(); | |
2124 | |
2125 while (awy) { | |
2126 a = (struct away_message *)awy->data; | |
2127 opt = gtk_menu_item_new_with_label(a->name); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2128 g_signal_connect(G_OBJECT(opt), "activate", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2129 G_CALLBACK(set_default_away), (gpointer)index); |
3366 | 2130 gtk_widget_show(opt); |
4635 | 2131 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
3366 | 2132 |
2133 awy = awy->next; | |
2134 index++; | |
2135 } | |
2136 | |
2137 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2138 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
2139 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
2140 } | |
2141 | |
2142 GtkWidget *pref_fg_picture = NULL; | |
2143 GtkWidget *pref_bg_picture = NULL; | |
2144 | |
2145 void destroy_colorsel(GtkWidget *w, gpointer d) | |
2146 { | |
2147 if (d) { | |
2148 gtk_widget_destroy(fgcseld); | |
2149 fgcseld = NULL; | |
2150 } else { | |
2151 gtk_widget_destroy(bgcseld); | |
2152 bgcseld = NULL; | |
2153 } | |
3032 | 2154 } |
2155 | |
3366 | 2156 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 2157 { |
3366 | 2158 if ((int)d == 1) { |
2159 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2160 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3818 | 2161 &fgcolor); |
3366 | 2162 destroy_colorsel(NULL, (void *)1); |
2163 update_color(NULL, pref_fg_picture); | |
2164 } else { | |
2165 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2166 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3818 | 2167 &bgcolor); |
3366 | 2168 destroy_colorsel(NULL, (void *)0); |
2169 update_color(NULL, pref_bg_picture); | |
2170 } | |
4421 | 2171 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); |
3032 | 2172 } |
2173 | |
3366 | 2174 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 2175 { |
3366 | 2176 GdkColor c; |
2177 GtkStyle *style; | |
2178 c.pixel = 0; | |
3500 | 2179 |
3366 | 2180 if (pic == pref_fg_picture) { |
3818 | 2181 if (font_options & OPT_FONT_FGCOL) { |
2182 c.red = fgcolor.red; | |
2183 c.blue = fgcolor.blue; | |
2184 c.green = fgcolor.green; | |
3366 | 2185 } else { |
2186 c.red = 0; | |
2187 c.blue = 0; | |
2188 c.green = 0; | |
2189 } | |
2190 } else { | |
3818 | 2191 if (font_options & OPT_FONT_BGCOL) { |
2192 c.red = bgcolor.red; | |
2193 c.blue = bgcolor.blue; | |
2194 c.green = bgcolor.green; | |
3366 | 2195 } else { |
2196 c.red = 0xffff; | |
2197 c.blue = 0xffff; | |
2198 c.green = 0xffff; | |
2199 } | |
2200 } | |
2201 | |
2202 style = gtk_style_new(); | |
2203 style->bg[0] = c; | |
2204 gtk_widget_set_style(pic, style); | |
4296 | 2205 g_object_unref(style); |
3366 | 2206 } |
4064 | 2207 |
3366 | 2208 void set_default_away(GtkWidget *w, gpointer i) |
2209 { | |
2210 | |
2211 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
2212 |
3366 | 2213 if (away_messages == NULL) |
3818 | 2214 default_away = NULL; |
3366 | 2215 else if ((int)i >= length) |
3818 | 2216 default_away = g_slist_nth_data(away_messages, length - 1); |
3366 | 2217 else |
3818 | 2218 default_away = g_slist_nth_data(away_messages, (int)i); |
3366 | 2219 } |
3500 | 2220 |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
2221 #ifndef _WIN32 |
4428 | 2222 static gboolean program_is_valid(const char *program) |
2223 { | |
2224 GError *error = NULL; | |
2225 char **argv; | |
4869 | 2226 gchar *progname; |
4428 | 2227 gboolean is_valid = FALSE; |
2228 | |
2229 if (program == NULL || *program == '\0') { | |
2230 return FALSE; | |
2231 } | |
2232 | |
2233 if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2234 gaim_debug(GAIM_DEBUG_ERROR, "program_is_valid", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2235 "Could not parse program '%s': %s\n", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2236 program, error->message); |
4800 | 2237 g_error_free(error); |
4428 | 2238 return FALSE; |
2239 } | |
2240 | |
2241 if (argv == NULL) { | |
2242 return FALSE; | |
2243 } | |
2244 | |
4869 | 2245 progname = g_find_program_in_path(argv[0]); |
2246 is_valid = (progname != NULL); | |
4428 | 2247 |
2248 g_strfreev(argv); | |
4869 | 2249 g_free(progname); |
2250 | |
4428 | 2251 return is_valid; |
2252 } | |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
2253 #endif |
4428 | 2254 |
3366 | 2255 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
2256 { | |
4635 | 2257 int *value = g_object_get_data(G_OBJECT(spin), "val"); |
3366 | 2258 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
2259 } | |
4064 | 2260 |
3427 | 2261 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 2262 { |
2263 GtkWidget *hbox; | |
2264 GtkWidget *label; | |
2265 GtkWidget *spin; | |
2266 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
2267 |
3366 | 2268 hbox = gtk_hbox_new(FALSE, 5); |
2269 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
2270 gtk_widget_show(hbox); | |
2271 | |
3427 | 2272 label = gtk_label_new_with_mnemonic(title); |
3366 | 2273 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2274 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
2275 |
3366 | 2276 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
2277 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
4635 | 2278 g_object_set_data(G_OBJECT(spin), "val", val); |
2279 gtk_widget_set_size_request(spin, 50, -1); | |
3366 | 2280 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2281 g_signal_connect(G_OBJECT(adjust), "value-changed", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2282 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
3366 | 2283 gtk_widget_show(spin); |
3500 | 2284 |
3427 | 2285 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
2286 | |
2287 if (sg) { | |
2288 gtk_size_group_add_widget(sg, label); | |
2289 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 2290 |
3427 | 2291 } |
2292 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2293 } |
1 | 2294 |
4635 | 2295 void dropdown_set(GObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2296 { |
4635 | 2297 int opt = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
2298 int clear = GPOINTER_TO_INT(g_object_get_data(w, "clear")); | |
3500 | 2299 |
3366 | 2300 if (clear != -1) { |
2301 *option = *option & ~clear; | |
2302 *option = *option | opt; | |
2303 } else { | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2304 gaim_debug(GAIM_DEBUG_MISC, "dropdown_set", "HELLO %d\n", opt); |
3366 | 2305 *option = opt; |
2306 } | |
3500 | 2307 |
4634 | 2308 if (option == (int*)&global_proxy_info.proxytype) { |
3366 | 2309 if (opt == PROXY_NONE) |
2310 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
2311 else | |
2312 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
3818 | 2313 } else if (option == &web_browser) { |
3366 | 2314 if (opt == BROWSER_MANUAL) |
4428 | 2315 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), TRUE); |
3366 | 2316 else |
4428 | 2317 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), FALSE); |
3818 | 2318 } else if (option == (int*)&sound_options) { |
3366 | 2319 if (opt == OPT_SOUND_CMD) |
2320 gtk_widget_set_sensitive(sndcmd, TRUE); | |
2321 else | |
2322 gtk_widget_set_sensitive(sndcmd, FALSE); | |
4581 | 2323 gaim_sound_change_output_method(); |
4944 | 2324 } else if (option == (int*)&blist_options) { |
2325 gaim_gtk_blist_update_toolbar(); | |
3818 | 2326 } else if (option == (int*)&im_options) { |
2327 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2328 gaim_gtkconv_update_tabs(); |
3818 | 2329 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2330 gaim_gtkconv_update_im_button_style(); |
3818 | 2331 } else if (option == (int*)&chat_options) { |
2332 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2333 gaim_gtkconv_update_tabs(); |
3818 | 2334 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2335 gaim_gtkconv_update_chat_button_style(); |
4687 | 2336 // } else if (option == (int*)&blist_options) { |
2337 // set_blist_tab(); | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2338 } else if (option == (int *)&conv_placement_option) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2339 gaim_conv_placement_set_active(conv_placement_option); |
3366 | 2340 } |
1 | 2341 } |
2342 | |
3500 | 2343 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 2344 { |
4428 | 2345 va_list ap; |
2346 GList *menuitems = NULL; | |
2347 GtkWidget *dropdown = NULL; | |
2348 char *name; | |
2349 int id; | |
2350 | |
2351 va_start(ap, clear); | |
2352 while ((name = va_arg(ap, char *)) != NULL) { | |
2353 id = va_arg(ap, int); | |
2354 | |
2355 menuitems = g_list_prepend(menuitems, name); | |
2356 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(id)); | |
2357 } | |
2358 va_end(ap); | |
2359 | |
4433 | 2360 g_return_val_if_fail(menuitems != NULL, NULL); |
4428 | 2361 |
2362 menuitems = g_list_reverse(menuitems); | |
2363 | |
2364 dropdown = gaim_dropdown_from_list(box, title, option, clear, menuitems); | |
2365 | |
2366 g_list_free(menuitems); | |
2367 | |
2368 return dropdown; | |
2369 } | |
2370 | |
2371 static GtkWidget *gaim_dropdown_from_list(GtkWidget *box, const gchar *title, int *option, int clear, GList *menuitems) | |
2372 { | |
3366 | 2373 GtkWidget *dropdown, *opt, *menu; |
2374 GtkWidget *label; | |
2375 gchar *text; | |
2376 int value; | |
2377 int o = 0; | |
2378 GtkWidget *hbox; | |
1 | 2379 |
4428 | 2380 g_return_val_if_fail(menuitems != NULL, NULL); |
2381 | |
3366 | 2382 hbox = gtk_hbox_new(FALSE, 5); |
2383 gtk_container_add (GTK_CONTAINER (box), hbox); | |
2384 gtk_widget_show(hbox); | |
2385 | |
3427 | 2386 label = gtk_label_new_with_mnemonic(title); |
3366 | 2387 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2388 gtk_widget_show(label); | |
2389 | |
2390 dropdown = gtk_option_menu_new(); | |
2391 menu = gtk_menu_new(); | |
3500 | 2392 |
3427 | 2393 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 2394 |
4428 | 2395 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
2396 menuitems = g_list_next(menuitems); | |
2397 g_return_val_if_fail(menuitems != NULL, NULL); | |
2398 value = GPOINTER_TO_INT(menuitems->data); | |
2399 menuitems = g_list_next(menuitems); | |
2400 | |
3366 | 2401 opt = gtk_menu_item_new_with_label(text); |
4635 | 2402 g_object_set_data(G_OBJECT(opt), "value", GINT_TO_POINTER(value)); |
2403 g_object_set_data(G_OBJECT(opt), "clear", GINT_TO_POINTER(clear)); | |
5314
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2404 g_signal_connect(G_OBJECT(opt), "activate", |
1f901484599d
[gaim-migrate @ 5686]
Christian Hammond <chipx86@chipx86.com>
parents:
5297
diff
changeset
|
2405 G_CALLBACK(dropdown_set), (void *)option); |
3366 | 2406 gtk_widget_show(opt); |
2407 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 2408 |
4994 | 2409 if (((clear > -1) && ((*option & clear) == value)) || *option == value) { |
3366 | 2410 gtk_menu_set_active(GTK_MENU(menu), o); |
2411 } | |
2412 o++; | |
4428 | 2413 |
3366 | 2414 } |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2415 |
3500 | 2416 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 2417 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
2418 gtk_widget_show(dropdown); | |
3427 | 2419 return label; |
3500 | 2420 } |
2421 | |
3366 | 2422 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 2423 { |
3366 | 2424 /* more stuff stolen from X-Chat */ |
2425 GtkWidget *swid; | |
2426 GdkColor c; | |
2427 GtkStyle *style; | |
2428 c.pixel = 0; | |
2429 if (fgc) { | |
3818 | 2430 if (font_options & OPT_FONT_FGCOL) { |
2431 c.red = fgcolor.red; | |
2432 c.blue = fgcolor.blue; | |
2433 c.green = fgcolor.green; | |
3366 | 2434 } else { |
2435 c.red = 0; | |
2436 c.blue = 0; | |
2437 c.green = 0; | |
2438 } | |
2439 } else { | |
3818 | 2440 if (font_options & OPT_FONT_BGCOL) { |
2441 c.red = bgcolor.red; | |
2442 c.blue = bgcolor.blue; | |
2443 c.green = bgcolor.green; | |
3366 | 2444 } else { |
2445 c.red = 0xffff; | |
2446 c.blue = 0xffff; | |
2447 c.green = 0xffff; | |
2448 } | |
2449 } | |
1 | 2450 |
3366 | 2451 style = gtk_style_new(); |
2452 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2453 |
3366 | 2454 swid = gtk_event_box_new(); |
2455 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
4296 | 2456 g_object_unref(style); |
4635 | 2457 gtk_widget_set_size_request(GTK_WIDGET(swid), 40, -1); |
3366 | 2458 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); |
2459 gtk_widget_show(swid); | |
2460 return swid; | |
1 | 2461 } |
4064 | 2462 |
3366 | 2463 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2464 { |
3366 | 2465 int i = 0; |
2466 char *fontname; | |
2467 | |
3473 | 2468 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 2469 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2470 |
3818 | 2471 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
2472 fontface[i] = fontname[i]; | |
3366 | 2473 i++; |
2474 } | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2475 |
3818 | 2476 fontface[i] = 0; |
3366 | 2477 g_free(fontname); |
4635 | 2478 |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2479 gaim_conversation_foreach(gaim_gtkconv_update_font_face); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2480 } |
3500 | 2481 |