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