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