Mercurial > pidgin
annotate src/prefs.c @ 3502:a8ecf770ff43
[gaim-migrate @ 3566]
Fixy.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 14 Sep 2002 05:25:12 +0000 |
parents | b79894c97bed |
children | 4f9e12e90ea3 |
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 | |
42 /* temporary preferences */ | |
43 static guint misc_options_new; | |
44 static guint logging_options_new; | |
45 static guint blist_options_new; | |
46 static guint convo_options_new; | |
47 static guint im_options_new; | |
48 static guint chat_options_new; | |
49 static guint font_options_new; | |
50 static guint sound_options_new; | |
51 static char *sound_file_new[NUM_SOUNDS]; | |
52 static guint away_options_new; | |
53 static guint away_resend_new; | |
54 static int auto_away_new; | |
55 static int report_idle_new; | |
56 static int proxytype_new; | |
57 static struct away_message* default_away_new; | |
58 static int web_browser_new; | |
59 static char sound_cmd_new[2048]; | |
60 static char web_command_new[2048]; | |
61 static int fontsize_new; | |
62 GdkColor fgcolor_new, bgcolor_new; | |
63 static struct window_size conv_size_new, buddy_chat_size_new; | |
64 char fontface_new[128]; | |
65 char fontface[128]; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
66 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
67 GtkWidget *prefs_away_list = NULL; |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
68 GtkWidget *prefs_away_menu = NULL; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
69 GtkWidget *preftree = NULL; |
3366 | 70 GtkWidget *fontseld = NULL; |
71 | |
3379 | 72 GtkListStore *prefs_away_store = NULL; |
3366 | 73 |
74 static int sound_row_sel = 0; | |
75 static char *last_sound_dir = NULL; | |
76 | |
77 static GtkWidget *sounddialog = NULL; | |
78 static GtkWidget *browser_entry = NULL; | |
79 static GtkWidget *sound_entry = NULL; | |
80 static GtkWidget *away_text = NULL; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
81 GtkCTreeNode *general_node = NULL; |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
82 GtkCTreeNode *deny_node = NULL; |
2254 | 83 GtkWidget *prefs_proxy_frame = NULL; |
3366 | 84 static GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
3427 | 85 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
3366 | 86 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
87 static GtkWidget *show_color_pref(GtkWidget *, gboolean); | |
88 static void delete_prefs(GtkWidget *, void *); | |
89 void set_default_away(GtkWidget *, gpointer); | |
3500 | 90 static void apply_prefs(); |
1026 | 91 |
3366 | 92 struct debug_window *dw = NULL; |
93 static GtkWidget *prefs = NULL; | |
94 GtkWidget *debugbutton = NULL; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
95 |
3366 | 96 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
97 int v; | |
3500 | 98 |
3485 | 99 prefs = NULL; |
100 for (v = 0; v < NUM_SOUNDS; v++) { | |
101 if (sound_file_new[v]) { | |
3366 | 102 g_free(sound_file_new[v]); |
3485 | 103 sound_file_new[v] = NULL; |
104 } | |
105 } | |
106 sound_entry = NULL; | |
107 browser_entry = NULL; | |
108 debugbutton=NULL; | |
109 if(sounddialog) | |
3379 | 110 gtk_widget_destroy(sounddialog); |
3500 | 111 g_object_unref(G_OBJECT(prefs_away_store)); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
112 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
113 |
3366 | 114 GtkWidget *preflabel; |
115 GtkWidget *prefsnotebook; | |
116 GtkTreeStore *prefstree; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
117 |
3500 | 118 static void set_misc_options(); |
3366 | 119 static void set_logging_options(); |
3500 | 120 static void set_blist_options(); |
3366 | 121 static void set_convo_options(); |
122 static void set_im_options(); | |
123 static void set_chat_options(); | |
124 static void set_font_options(); | |
125 static void set_sound_options(); | |
126 static void set_away_options(); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
127 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
128 #define PROXYHOST 0 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
129 #define PROXYPORT 1 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
130 #define PROXYTYPE 2 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
131 #define PROXYUSER 3 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
132 #define PROXYPASS 4 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
133 static void proxy_print_option(GtkEntry *entry, int entrynum) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
134 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
135 if (entrynum == PROXYHOST) |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
136 g_snprintf(proxyhost, sizeof(proxyhost), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
137 else if (entrynum == PROXYPORT) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
138 proxyport = atoi(gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
139 else if (entrynum == PROXYUSER) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
140 g_snprintf(proxyuser, sizeof(proxyuser), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
141 else if (entrynum == PROXYPASS) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
142 g_snprintf(proxypass, sizeof(proxypass), "%s", gtk_entry_get_text(entry)); |
3500 | 143 apply_prefs(); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
144 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
145 |
3366 | 146 |
3427 | 147 static GtkWidget *make_frame(GtkWidget *ret, char *text) { |
148 GtkWidget *vbox, *label, *hbox; | |
149 char labeltext[256]; | |
3500 | 150 |
3427 | 151 vbox = gtk_vbox_new(FALSE, 6); |
152 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
153 label = gtk_label_new(NULL); | |
154 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
155 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
156 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
157 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
158 hbox = gtk_hbox_new(FALSE, 6); | |
159 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
160 label = gtk_label_new(" "); | |
161 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
162 vbox = gtk_vbox_new(FALSE, 6); | |
163 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
164 return vbox; | |
165 } | |
166 | |
3366 | 167 /* OK, Apply and Cancel */ |
168 | |
169 static void apply_cb(GtkWidget *button, void *data) | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
170 { |
3500 | 171 apply_prefs(); |
172 } | |
173 | |
174 static void apply_prefs() | |
175 { | |
3366 | 176 int r; |
177 if (misc_options != misc_options_new) | |
178 set_misc_options(); | |
179 if (logging_options != logging_options_new) | |
180 set_logging_options(); | |
181 if (blist_options != blist_options_new) | |
182 set_blist_options(); | |
3500 | 183 if (convo_options != convo_options_new) |
3366 | 184 set_convo_options(); |
3500 | 185 if (im_options != im_options_new) |
3366 | 186 set_im_options(); |
3500 | 187 if (chat_options != chat_options_new) |
3366 | 188 set_chat_options(); |
189 chat_options = chat_options_new; | |
3500 | 190 if (font_options != font_options_new) |
3366 | 191 set_font_options(); |
3500 | 192 if (sound_options != sound_options_new) |
3366 | 193 set_sound_options(); |
194 for (r = 0; r < NUM_SOUNDS; r++) { | |
195 if (sound_file[r]) | |
196 g_free(sound_file[r]); | |
3485 | 197 sound_file[r] = g_strdup(sound_file_new[r]); |
3366 | 198 } |
3500 | 199 if (away_options != away_options_new) |
3366 | 200 set_away_options(); |
201 away_resend = away_resend_new; | |
202 auto_away = auto_away_new; | |
203 report_idle = report_idle_new; | |
204 web_browser = web_browser_new; | |
3500 | 205 proxytype = proxytype_new; |
3366 | 206 default_away = default_away_new; |
207 fontsize = fontsize_new; | |
208 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", sound_cmd_new); | |
209 g_snprintf(web_command, sizeof(web_command), "%s", web_command_new); | |
210 memcpy(&conv_size, &conv_size_new, sizeof(struct window_size)); | |
3500 | 211 memcpy(&conv_size, &conv_size_new, sizeof(struct window_size)); |
3366 | 212 memcpy(&fgcolor, &fgcolor_new, sizeof(GdkColor)); |
213 memcpy(&bgcolor, &bgcolor_new, sizeof(GdkColor)); | |
2254 | 214 |
3366 | 215 |
216 g_snprintf(fontface, sizeof(fontface), fontface_new); | |
217 update_convo_font(); | |
218 update_convo_color(); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
219 save_prefs(); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
220 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
221 |
3366 | 222 |
223 static void ok_cb(GtkWidget *button, void *data) | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
224 { |
3366 | 225 apply_cb(button, data); |
226 gtk_widget_destroy(prefs); | |
227 } | |
3427 | 228 |
3366 | 229 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { |
230 GtkTreeIter iter; | |
3427 | 231 char text[128]; |
3366 | 232 GValue val = { 0, }; |
233 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
3500 | 234 |
3366 | 235 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
236 return; | |
237 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3500 | 238 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
3427 | 239 g_value_get_string(&val)); |
240 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
3366 | 241 g_value_unset (&val); |
242 gtk_tree_model_get_value (model, &iter, 2, &val); | |
243 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
244 | |
245 } | |
246 | |
247 /* These are the pages in the preferences notebook */ | |
248 GtkWidget *interface_page() { | |
249 GtkWidget *ret; | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
250 GtkWidget *vbox; |
3427 | 251 ret = gtk_vbox_new(FALSE, 18); |
252 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 253 |
3427 | 254 vbox = make_frame(ret, _("Interface Options")); |
255 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */ | |
256 /* This really shouldn't be in preferences at all */ | |
3500 | 257 debugbutton = gaim_button(_("Show _Debug Window"), &misc_options_new, OPT_MISC_DEBUG, vbox); |
258 | |
3366 | 259 |
3427 | 260 gaim_button(_("Use _borderless buttons"), &misc_options_new, OPT_MISC_COOL_LOOK, vbox); |
3500 | 261 |
3427 | 262 gtk_widget_show_all(ret); |
3366 | 263 return ret; |
264 } | |
265 | |
266 GtkWidget *font_page() { | |
267 GtkWidget *ret; | |
268 GtkWidget *button; | |
269 GtkWidget *vbox, *hbox; | |
270 GtkWidget *select = NULL; | |
3427 | 271 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 272 |
3427 | 273 ret = gtk_vbox_new(FALSE, 18); |
274 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 275 |
3427 | 276 vbox = make_frame(ret, _("Style")); |
3500 | 277 gaim_button(_("_Bold"), &font_options_new, OPT_FONT_BOLD, vbox); |
3427 | 278 gaim_button(_("_Italics"), &font_options_new, OPT_FONT_ITALIC, vbox); |
279 gaim_button(_("_Underline"), &font_options_new, OPT_FONT_UNDERLINE, vbox); | |
280 gaim_button(_("_Strikethough"), &font_options_new, OPT_FONT_STRIKE, vbox); | |
3500 | 281 |
3427 | 282 vbox = make_frame(ret, _("Face")); |
283 hbox = gtk_hbox_new(FALSE, 6); | |
284 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
285 button = gaim_button(_("Use custo_m face"), &font_options_new, OPT_FONT_FACE, hbox); | |
286 gtk_size_group_add_widget(sg, button); | |
287 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
3366 | 288 |
289 if (!(font_options_new & OPT_FONT_FACE)) | |
290 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
291 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
3500 | 292 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); |
3366 | 293 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
294 | |
295 hbox = gtk_hbox_new(FALSE, 5); | |
296 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 297 button = gaim_button(_("Use custom si_ze"), &font_options_new, OPT_FONT_SIZE, hbox); |
298 gtk_size_group_add_widget(sg, button); | |
299 select = gaim_labeled_spin_button(hbox, NULL, &fontsize_new, 1, 7, NULL); | |
3366 | 300 if (!(font_options_new & OPT_FONT_SIZE)) |
301 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
302 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
303 | |
3500 | 304 vbox = make_frame(ret, _("Color")); |
3366 | 305 hbox = gtk_hbox_new(FALSE, 5); |
306 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 307 |
308 | |
3427 | 309 button = gaim_button(_("_Text color"), &font_options_new, OPT_FONT_FGCOL, hbox); |
310 gtk_size_group_add_widget(sg, button); | |
311 | |
312 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
313 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 314 pref_fg_picture = show_color_pref(hbox, TRUE); |
315 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), | |
316 pref_fg_picture); | |
3427 | 317 |
3366 | 318 if (!(font_options_new & OPT_FONT_FGCOL)) |
319 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
320 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
321 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_fgcolor_dialog), NULL); | |
322 hbox = gtk_hbox_new(FALSE, 5); | |
323 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 324 |
3427 | 325 button = gaim_button(_("Bac_kground color"), &font_options_new, OPT_FONT_BGCOL, hbox); |
326 gtk_size_group_add_widget(sg, button); | |
327 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
328 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 329 pref_bg_picture = show_color_pref(hbox, FALSE); |
3427 | 330 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), |
3366 | 331 pref_bg_picture); |
3472 | 332 |
3366 | 333 if (!(font_options_new & OPT_FONT_BGCOL)) |
334 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
335 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_bgcolor_dialog), NULL); | |
336 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
337 | |
3427 | 338 gtk_widget_show_all(ret); |
3366 | 339 return ret; |
340 } | |
341 | |
342 | |
343 GtkWidget *messages_page() { | |
344 GtkWidget *ret; | |
345 GtkWidget *vbox; | |
3427 | 346 ret = gtk_vbox_new(FALSE, 18); |
347 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 348 |
3427 | 349 vbox = make_frame (ret, _("Display")); |
350 gaim_button(_("Show graphical _smileys"), &convo_options_new, OPT_CONVO_SHOW_SMILEY, vbox); | |
351 gaim_button(_("Show _timestamp on messages"), &convo_options_new, OPT_CONVO_SHOW_TIME, vbox); | |
352 gaim_button(_("Show _URLs as links"), &convo_options_new, OPT_CONVO_SEND_LINKS, vbox); | |
353 gaim_button(_("_Highlight misspelled words"), &convo_options_new, OPT_CONVO_CHECK_SPELLING, vbox); | |
3500 | 354 |
3427 | 355 vbox = make_frame (ret, _("Ignore")); |
356 gaim_button(_("Ignore c_olors"), &convo_options_new, OPT_CONVO_IGNORE_COLOUR, vbox); | |
357 gaim_button(_("Ignore font _faces"), &convo_options_new, OPT_CONVO_IGNORE_FONTS, vbox); | |
358 gaim_button(_("Ignore font si_zes"), &convo_options_new, OPT_CONVO_IGNORE_SIZES, vbox); | |
359 gaim_button(_("Ignore Ti_K Automated Messages"), &away_options_new, OPT_AWAY_TIK_HACK, vbox); | |
3500 | 360 |
3427 | 361 gtk_widget_show_all(ret); |
3366 | 362 return ret; |
363 } | |
364 | |
365 GtkWidget *hotkeys_page() { | |
366 GtkWidget *ret; | |
367 GtkWidget *vbox; | |
3427 | 368 ret = gtk_vbox_new(FALSE, 18); |
369 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 370 |
3427 | 371 vbox = make_frame(ret, _("Send Message")); |
372 gaim_button(_("_Enter sends message"), &convo_options_new, OPT_CONVO_ENTER_SENDS, vbox); | |
373 gaim_button(_("C_ontrol-Enter sends message"), &convo_options_new, OPT_CONVO_CTL_ENTER, vbox); | |
3500 | 374 |
3427 | 375 vbox = make_frame (ret, _("Window Closing")); |
376 gaim_button(_("E_scape closes window"), &convo_options_new, OPT_CONVO_ESC_CAN_CLOSE, vbox); | |
377 gaim_button(_("Control-_W closes window"), &convo_options_new, OPT_CONVO_CTL_W_CLOSES, vbox); | |
3366 | 378 |
3427 | 379 vbox = make_frame(ret, "Insertions"); |
380 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options_new, OPT_CONVO_CTL_CHARS, vbox); | |
381 gaim_button(_("Control-(number) inserts _smileys"), &convo_options_new, OPT_CONVO_CTL_SMILEYS, vbox); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
382 |
3427 | 383 gtk_widget_show_all(ret); |
3366 | 384 return ret; |
385 } | |
386 | |
387 GtkWidget *list_page() { | |
388 GtkWidget *ret; | |
389 GtkWidget *vbox; | |
3427 | 390 ret = gtk_vbox_new(FALSE, 18); |
391 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 392 |
3472 | 393 /* fixme: docklet |
394 gaim_button(_("Automatically show buddy list on sign on"), &blist_options_new, | |
395 OPT_BLIST_APP_BUDDY_SHOW, vbox); | |
396 gaim_button(_("Display Buddy List near applet"), &blist_options_new, OPT_BLIST_NEAR_APPLET, vbox); */ | |
397 | |
3427 | 398 vbox = make_frame (ret, _("Buttons")); |
399 gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options_new, OPT_BLIST_NO_BUTTONS, vbox); | |
400 gaim_button(_("Show _pictures on buttons"), &blist_options_new, OPT_BLIST_SHOW_BUTTON_XPM, vbox); | |
3366 | 401 |
3427 | 402 vbox = make_frame (ret, _("Buddy List Window")); |
403 gaim_button(_("_Save Window Size/Position"), &blist_options_new, OPT_BLIST_SAVED_WINDOWS, vbox); | |
404 gaim_button(_("_Raise Window on Events"), &blist_options_new, OPT_BLIST_POPUP, vbox); | |
3366 | 405 |
3427 | 406 vbox = make_frame (ret, _("Group Display")); |
407 gaim_button(_("Hide _groups with no online buddies"), &blist_options_new, OPT_BLIST_NO_MT_GRP, vbox); | |
408 gaim_button(_("Show _numbers in groups"), &blist_options_new, OPT_BLIST_SHOW_GRPNUM, vbox); | |
3366 | 409 |
3427 | 410 vbox = make_frame (ret, _("Buddy Display")); |
411 gaim_button(_("Show buddy type _icons"), &blist_options_new, OPT_BLIST_SHOW_PIXMAPS, vbox); | |
412 gaim_button(_("Show _warning levels"), &blist_options_new, OPT_BLIST_SHOW_WARN, vbox); | |
413 gaim_button(_("Show idle _times"), &blist_options_new, OPT_BLIST_SHOW_IDLETIME, vbox); | |
414 gaim_button(_("Grey i_dle buddies"), &blist_options_new, OPT_BLIST_GREY_IDLERS, vbox); | |
3366 | 415 |
3427 | 416 gtk_widget_show_all(ret); |
3366 | 417 return ret; |
418 } | |
419 | |
420 GtkWidget *im_page() { | |
421 GtkWidget *ret; | |
3500 | 422 GtkWidget *vbox; |
3427 | 423 GtkWidget *typingbutton, *widge; |
424 GtkSizeGroup *sg; | |
3366 | 425 |
3427 | 426 ret = gtk_vbox_new(FALSE, 18); |
427 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
428 | |
429 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
430 | |
431 vbox = make_frame (ret, _("Window")); | |
3500 | 432 widge = gaim_dropdown(vbox, "Show _buttons as:", &im_options_new, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
433 "Pictures", OPT_IM_BUTTON_XPM, | |
3366 | 434 "Text", OPT_IM_BUTTON_TEXT, |
435 "Pictures and text", OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
3427 | 436 gtk_size_group_add_widget(sg, widge); |
437 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
438 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size_new.width, 25, 9999, sg); | |
439 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size_new.height, 25, 9999, sg); | |
440 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size_new.entry_height, 25, 9999, sg); | |
441 gaim_button(_("_Raise windows on events"), &im_options_new, OPT_IM_POPUP, vbox); | |
442 gaim_button(_("Hide window on _send"), &im_options_new, OPT_IM_POPDOWN, vbox); | |
3366 | 443 gtk_widget_show (vbox); |
444 | |
3427 | 445 vbox = make_frame (ret, _("Buddy Icons")); |
446 gaim_button(_("Hide Buddy _Icons"), &im_options_new, OPT_IM_HIDE_ICONS, vbox); | |
447 gaim_button(_("Disable Buddy Icon A_nimation"), &im_options_new, OPT_IM_NO_ANIMATION, vbox); | |
3366 | 448 |
3427 | 449 vbox = make_frame (ret, _("Display")); |
450 gaim_button(_("Show _logins in window"), &im_options_new, OPT_IM_LOGON, vbox); | |
3366 | 451 |
3427 | 452 vbox = make_frame (ret, _("Typing Notification")); |
453 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options_new, | |
3366 | 454 OPT_MISC_STEALTH_TYPING, vbox); |
455 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
3404 | 456 misc_options_new ^= OPT_MISC_STEALTH_TYPING; |
3366 | 457 |
3427 | 458 gtk_widget_show_all(ret); |
3366 | 459 return ret; |
460 } | |
461 | |
462 GtkWidget *chat_page() { | |
463 GtkWidget *ret; | |
464 GtkWidget *vbox; | |
3427 | 465 GtkWidget *dd; |
466 GtkSizeGroup *sg; | |
3366 | 467 |
3427 | 468 ret = gtk_vbox_new(FALSE, 18); |
469 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 470 |
3427 | 471 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
3366 | 472 |
3427 | 473 vbox = make_frame (ret, _("Window")); |
474 dd = gaim_dropdown(vbox, "Show _buttons as:", &chat_options_new, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, | |
3500 | 475 "Pictures", OPT_CHAT_BUTTON_XPM, |
3427 | 476 "Text", OPT_CHAT_BUTTON_TEXT, |
477 "Pictures and Text", OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
478 gtk_size_group_add_widget(sg, dd); | |
479 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
480 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size_new.width, 25, 9999, sg); | |
481 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size_new.height, 25, 9999, sg); | |
482 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size_new.entry_height, 25, 9999, sg); | |
483 gaim_button(_("_Raise windows on events"), &chat_options_new, OPT_CHAT_POPUP, vbox); | |
3366 | 484 |
3427 | 485 vbox = make_frame (ret, _("Tab Completion")); |
486 gaim_button(_("_Tab-Complete Nicks"), &chat_options_new, OPT_CHAT_TAB_COMPLETE, vbox); | |
487 gaim_button(_("_Old-Style Tab Completion"), &chat_options_new, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
488 | |
489 vbox = make_frame (ret, _("Display")); | |
490 gaim_button(_("_Show people joining/leaving in window"), &chat_options_new, OPT_CHAT_LOGON, vbox); | |
491 gaim_button(_("Co_lorize screennames"), &chat_options_new, OPT_CHAT_COLORIZE, vbox); | |
492 | |
493 gtk_widget_show_all(ret); | |
3366 | 494 return ret; |
495 } | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
496 |
3366 | 497 GtkWidget *tab_page() { |
498 GtkWidget *ret; | |
499 GtkWidget *vbox; | |
3427 | 500 GtkWidget *dd; |
501 GtkSizeGroup *sg; | |
502 ret = gtk_vbox_new(FALSE, 18); | |
503 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 504 |
3427 | 505 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 506 |
3427 | 507 vbox = make_frame (ret, _("IM Tabs")); |
3500 | 508 dd = gaim_dropdown(vbox, "Tab _Placement:", &im_options_new, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
509 "Top", 0, | |
3366 | 510 "Bottom", OPT_IM_BR_TAB, |
511 "Left", OPT_IM_SIDE_TAB, | |
512 "Right", OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
3427 | 513 gtk_size_group_add_widget(sg, dd); |
514 gaim_button(_("Show all _Instant Messages in one tabbed\nwindow"), &im_options_new, OPT_IM_ONE_WINDOW, vbox); | |
515 gaim_button(_("Show a_liases in tabs/titles"), &im_options_new, OPT_IM_ALIAS_TAB, vbox); | |
3366 | 516 |
3427 | 517 vbox = make_frame (ret, _("Chat Tabs")); |
518 dd = gaim_dropdown(vbox, "Tab _Placement:", &chat_options_new, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, | |
3500 | 519 "Top", 0, |
3427 | 520 "Bottom", OPT_CHAT_BR_TAB, |
521 "Left", OPT_CHAT_SIDE_TAB, | |
522 "Right", OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
523 gtk_size_group_add_widget(sg, dd); | |
524 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options_new, OPT_CHAT_ONE_WINDOW, | |
3366 | 525 vbox); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
526 |
3427 | 527 vbox = make_frame (ret, _("Combined Tabs")); |
528 gaim_button(_("Show IMs and chats in _same tabbed\nwindow."), &convo_options_new, OPT_CONVO_COMBINE, vbox); | |
3500 | 529 |
3427 | 530 vbox = make_frame (ret, _("Buddy List Tabs")); |
3500 | 531 dd = gaim_dropdown(vbox, "Tab _Placement:", &blist_options_new, OPT_BLIST_BOTTOM_TAB, |
532 "Top", 0, | |
3366 | 533 "Bottom", OPT_BLIST_BOTTOM_TAB, NULL); |
3427 | 534 gtk_size_group_add_widget(sg, dd); |
3500 | 535 |
3427 | 536 gtk_widget_show_all(ret); |
3366 | 537 return ret; |
538 } | |
539 | |
540 GtkWidget *proxy_page() { | |
541 GtkWidget *ret; | |
542 GtkWidget *vbox; | |
543 GtkWidget *entry; | |
544 GtkWidget *label; | |
545 GtkWidget *hbox; | |
546 GtkWidget *table; | |
547 | |
3427 | 548 ret = gtk_vbox_new(FALSE, 18); |
549 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 550 |
3427 | 551 vbox = make_frame (ret, _("Proxy Type")); |
552 gaim_dropdown(vbox, "Proxy _Type:", &proxytype_new, -1, | |
3500 | 553 "No Proxy", PROXY_NONE, |
3366 | 554 "SOCKS 4", PROXY_SOCKS4, |
555 "SOCKS 5", PROXY_SOCKS5, | |
556 "HTTP", PROXY_HTTP, NULL); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
557 |
2254 | 558 table = gtk_table_new(2, 2, FALSE); |
559 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
560 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
561 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | |
562 | |
3427 | 563 vbox = make_frame(ret, _("Proxy Server")); |
564 prefs_proxy_frame = vbox; | |
2254 | 565 |
566 if (proxytype == PROXY_NONE) | |
3427 | 567 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
2254 | 568 |
569 table = gtk_table_new(2, 4, FALSE); | |
570 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
571 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
572 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
3427 | 573 gtk_container_add(GTK_CONTAINER(vbox), table); |
2254 | 574 |
575 | |
3427 | 576 label = gtk_label_new_with_mnemonic(_("_Host")); |
2254 | 577 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
578 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
|
579 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
580 entry = gtk_entry_new(); |
3427 | 581 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 582 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
583 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
584 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYHOST); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
585 gtk_entry_set_text(GTK_ENTRY(entry), proxyhost); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
586 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
587 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
588 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
589 |
3427 | 590 label = gtk_label_new_with_mnemonic(_("Port")); |
2254 | 591 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
592 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
|
593 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
594 entry = gtk_entry_new(); |
3427 | 595 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 596 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
597 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
598 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPORT); |
2254 | 599 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
600 if (proxyport) { |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
601 char buf[128]; |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
602 g_snprintf(buf, sizeof(buf), "%d", proxyport); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
603 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
604 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
605 |
3427 | 606 label = gtk_label_new_with_mnemonic(_("_User")); |
2254 | 607 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
608 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
|
609 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
610 entry = gtk_entry_new(); |
3427 | 611 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 612 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
613 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
614 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYUSER); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
615 gtk_entry_set_text(GTK_ENTRY(entry), proxyuser); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
616 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
617 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
618 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
619 |
3427 | 620 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
2254 | 621 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
622 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
|
623 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
624 entry = gtk_entry_new(); |
3427 | 625 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 626 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
|
627 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
628 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
629 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPASS); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
630 gtk_entry_set_text(GTK_ENTRY(entry), proxypass); |
3500 | 631 |
3427 | 632 gtk_widget_show_all(ret); |
3366 | 633 return ret; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
634 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
635 |
3432 | 636 static void browser_print_option(GtkEntry *entry, void *nullish) { |
637 g_snprintf(web_command_new, sizeof(web_command_new), "%s", gtk_entry_get_text(entry)); | |
638 } | |
639 | |
3366 | 640 GtkWidget *browser_page() { |
641 GtkWidget *ret; | |
642 GtkWidget *vbox, *hbox; | |
643 GtkWidget *label; | |
3427 | 644 GtkSizeGroup *sg; |
645 | |
646 ret = gtk_vbox_new(FALSE, 18); | |
647 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
648 | |
649 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
650 |
3427 | 651 vbox = make_frame (ret, _("Browser Selection")); |
3500 | 652 label = gaim_dropdown(vbox, "_Browser", &web_browser_new, -1, |
3427 | 653 "Netscape", BROWSER_NETSCAPE, |
654 "Konqueror", BROWSER_KONQ, | |
655 "Mozilla", BROWSER_MOZILLA, | |
656 "Manual", BROWSER_MANUAL, | |
3472 | 657 /* fixme: GNOME binary helper |
658 "GNOME URL Handler", BROWSER_GNOME, */ | |
3427 | 659 "Galeon", BROWSER_GALEON, |
660 "Opera", BROWSER_OPERA, NULL); | |
661 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
662 gtk_size_group_add_widget(sg, label); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
663 |
3366 | 664 hbox = gtk_hbox_new(FALSE, 5); |
665 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
3427 | 666 label = gtk_label_new_with_mnemonic("_Manual: "); |
3366 | 667 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 668 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
669 gtk_size_group_add_widget(sg, label); | |
3366 | 670 browser_entry = gtk_entry_new(); |
3427 | 671 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3366 | 672 if (web_browser_new != BROWSER_MANUAL) |
673 gtk_widget_set_sensitive(browser_entry, FALSE); | |
674 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
|
675 |
3432 | 676 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command_new); |
677 gtk_signal_connect(GTK_OBJECT(browser_entry), "changed", | |
678 GTK_SIGNAL_FUNC(browser_print_option), NULL); | |
679 | |
3427 | 680 vbox = make_frame (ret, _("Browser Options")); |
681 gaim_button(_("Open new _window by default"), &misc_options_new, OPT_MISC_BROWSER_POPUP, vbox); | |
3366 | 682 |
3427 | 683 gtk_widget_show_all(ret); |
3366 | 684 return ret; |
3500 | 685 } |
3366 | 686 |
687 GtkWidget *logging_page() { | |
688 GtkWidget *ret; | |
689 GtkWidget *vbox; | |
3427 | 690 ret = gtk_vbox_new(FALSE, 18); |
691 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
692 |
3427 | 693 vbox = make_frame (ret, _("Message Logs")); |
3457 | 694 gaim_button(_("_Log all Instant Messages"), &logging_options_new, OPT_LOG_CONVOS, vbox); |
695 gaim_button(_("Log all c_hats"), &logging_options_new, OPT_LOG_CHATS, vbox); | |
3427 | 696 gaim_button(_("Strip _HTML from logs"), &logging_options_new, OPT_LOG_STRIP_HTML, vbox); |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
697 |
3427 | 698 vbox = make_frame (ret, _("System Logs")); |
699 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options_new, OPT_LOG_BUDDY_SIGNON, | |
3366 | 700 vbox); |
3427 | 701 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options_new, OPT_LOG_BUDDY_IDLE, |
3366 | 702 vbox); |
3427 | 703 gaim_button(_("Log when buddies go away/come _back"), &logging_options_new, OPT_LOG_BUDDY_AWAY, vbox); |
704 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options_new, OPT_LOG_MY_SIGNON, | |
3366 | 705 vbox); |
3427 | 706 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options_new, |
3366 | 707 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
708 |
3427 | 709 gtk_widget_show_all(ret); |
3366 | 710 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
711 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
712 |
3366 | 713 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
714 |
3366 | 715 static gint sound_cmd_yeah(GtkEntry *entry, GdkEvent *event, gpointer d) |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
716 { |
3366 | 717 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
718 return TRUE; | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
719 } |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
720 |
3366 | 721 GtkWidget *sound_page() { |
722 GtkWidget *ret; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
723 GtkWidget *label; |
3366 | 724 GtkWidget *vbox, *hbox; |
3427 | 725 GtkSizeGroup *sg; |
726 GtkWidget *dd; | |
3366 | 727 |
3427 | 728 ret = gtk_vbox_new(FALSE, 18); |
729 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
730 |
3427 | 731 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
732 |
3427 | 733 vbox = make_frame (ret, _("Sound Options")); |
3500 | 734 gaim_button(_("_No sounds when you log in"), &sound_options_new, OPT_SOUND_SILENT_SIGNON, vbox); |
735 gaim_button(_("_Sounds while away"), &sound_options_new, OPT_SOUND_WHEN_AWAY, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
736 |
3427 | 737 vbox = make_frame (ret, _("Sound Method")); |
738 dd = gaim_dropdown(vbox, "_Method", &sound_options_new, OPT_SOUND_BEEP | | |
3366 | 739 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL | |
3500 | 740 OPT_SOUND_CMD, |
3366 | 741 "Console Beep", OPT_SOUND_BEEP, |
742 #ifdef ESD_SOUND | |
3500 | 743 "ESD", OPT_SOUND_ESD, |
3366 | 744 #endif /* ESD_SOUND */ |
745 #ifdef ARTSC_SOUND | |
746 "ArtsC", OPT_SOUND_ARTSC, | |
747 #endif /* ARTSC_SOUND */ | |
748 #ifdef NAS_SOUND | |
749 "NAS", OPT_SOUND_NAS, | |
3500 | 750 #endif /* NAS_SOUND */ |
3366 | 751 "Internal", OPT_SOUND_NORMAL, |
752 "Command", OPT_SOUND_CMD, NULL); | |
3427 | 753 gtk_size_group_add_widget(sg, dd); |
754 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
755 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
756 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
757 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 758 |
3366 | 759 hbox = gtk_hbox_new(FALSE, 5); |
760 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 761 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 762 gtk_size_group_add_widget(sg, label); |
763 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 764 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
|
765 |
3366 | 766 sndcmd = gtk_entry_new(); |
3427 | 767 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
768 |
3366 | 769 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
770 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
771 gtk_widget_set_size_request(sndcmd, 75, -1); | |
3427 | 772 |
3366 | 773 gtk_widget_set_sensitive(sndcmd, (sound_options_new & OPT_SOUND_CMD)); |
774 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); | |
775 gtk_signal_connect(GTK_OBJECT(sndcmd), "focus_out_event", GTK_SIGNAL_FUNC(sound_cmd_yeah), NULL); | |
2746
a0da8be3db45
[gaim-migrate @ 2759]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2745
diff
changeset
|
776 |
3427 | 777 gtk_widget_show_all(ret); |
3366 | 778 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
779 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
780 |
3366 | 781 GtkWidget *away_page() { |
782 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
783 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
784 GtkWidget *hbox; |
3366 | 785 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
786 GtkWidget *button; |
3366 | 787 GtkWidget *select; |
3427 | 788 GtkWidget *dd; |
789 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
790 |
3427 | 791 ret = gtk_vbox_new(FALSE, 18); |
792 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
793 |
3427 | 794 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
795 |
3427 | 796 vbox = make_frame (ret, _("Away")); |
797 gaim_button(_("_Sending messages removes away status"), &away_options_new, OPT_AWAY_BACK_ON_IM, vbox); | |
798 gaim_button(_("_Queue new messages when away"), &away_options_new, OPT_AWAY_QUEUE, vbox); | |
799 gaim_button(_("_Ignore new conversations when away"), &away_options_new, OPT_AWAY_DISCARD, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
800 |
3427 | 801 vbox = make_frame (ret, _("Auto-response")); |
3366 | 802 hbox = gtk_hbox_new(FALSE, 0); |
803 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 804 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
805 &away_resend_new, 1, 24 * 60 * 60, sg); | |
3500 | 806 gaim_button(_("_Don't send auto-response"), &away_options_new, OPT_AWAY_NO_AUTO_RESP, vbox); |
3427 | 807 gaim_button(_("_Only send auto-response when idle"), &away_options_new, OPT_AWAY_IDLE_RESP, vbox); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
808 |
3366 | 809 if (away_options_new & OPT_AWAY_NO_AUTO_RESP) |
810 gtk_widget_set_sensitive(hbox, FALSE); | |
3500 | 811 |
3427 | 812 vbox = make_frame (ret, _("Idle")); |
3500 | 813 dd = gaim_dropdown(vbox, "Idle _Time Reporting:", &report_idle_new, -1, |
3427 | 814 "None", IDLE_NONE, |
3500 | 815 "Gaim Usage", IDLE_GAIM, |
3366 | 816 #ifdef USE_SCREENSAVER |
3500 | 817 "X Usage", IDLE_SCREENSAVER, |
3366 | 818 #endif |
3427 | 819 NULL); |
820 gtk_size_group_add_widget(sg, dd); | |
821 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
822 |
3427 | 823 vbox = make_frame (ret, _("Auto-away")); |
824 button = gaim_button(_("Set away _when idle"), &away_options_new, OPT_AWAY_AUTO, vbox); | |
825 select = gaim_labeled_spin_button(vbox, "_Minutes before setting away:", &auto_away_new, 1, 24 * 60, sg); | |
3366 | 826 if (!(away_options_new & OPT_AWAY_AUTO)) |
827 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
828 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
1 | 829 |
3427 | 830 label = gtk_label_new_with_mnemonic("Away m_essage:"); |
831 gtk_size_group_add_widget(sg, label); | |
832 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 833 hbox = gtk_hbox_new(FALSE, 0); |
834 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
835 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
836 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 837 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3366 | 838 if (!(away_options_new & OPT_AWAY_AUTO)) |
839 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); | |
840 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), prefs_away_menu); | |
841 default_away_menu_init(prefs_away_menu); | |
842 gtk_widget_show(prefs_away_menu); | |
843 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
3500 | 844 |
3427 | 845 gtk_widget_show_all(ret); |
3366 | 846 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
847 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
848 |
3366 | 849 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
850 { |
3366 | 851 GtkTreeModel *model = (GtkTreeModel *)data; |
852 GtkTreeIter iter; | |
853 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
3500 | 854 gint soundnum; |
3366 | 855 |
856 gtk_tree_model_get_iter (model, &iter, path); | |
857 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
858 |
3500 | 859 sound_options_new ^= sounds[soundnum].opt; |
3366 | 860 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options_new & sounds[soundnum].opt, -1); |
861 } | |
862 | |
863 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
864 { | |
865 guint32 tmp_sound = sound_options; | |
3401 | 866 char *save_me=NULL; |
3366 | 867 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) |
868 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
869 if (!(sound_options & sounds[sound_row_sel].opt)) | |
870 sound_options ^= sounds[sound_row_sel].opt; | |
3401 | 871 save_me = sound_file[sound_row_sel]; |
872 sound_file[sound_row_sel] = sound_file_new[sound_row_sel]; | |
3366 | 873 play_sound(sound_row_sel); |
3500 | 874 |
3401 | 875 sound_file[sound_row_sel] = save_me; |
3366 | 876 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
877 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
878 |
3366 | 879 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
|
880 { |
3366 | 881 /* This just resets a sound file back to default */ |
3485 | 882 if (sound_file_new[sound_row_sel]) { |
883 g_free(sound_file_new[sound_row_sel]); | |
884 sound_file_new[sound_row_sel] = NULL; | |
885 } | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
886 |
3366 | 887 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
888 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
889 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
890 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 891 { |
892 | |
893 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
894 |
1170 | 895 if (!GTK_IS_WIDGET(w2)) |
896 dest = w; | |
897 else | |
898 dest = w2; | |
899 | |
900 sounddialog = NULL; | |
901 | |
902 gtk_widget_destroy(dest); | |
903 } | |
904 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
905 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
906 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
907 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
908 |
1170 | 909 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
910 | |
911 /* If they type in a directory, change there */ | |
912 if (file_is_dir(file, sounddialog)) | |
913 return; | |
914 | |
915 /* Let's just be safe */ | |
3366 | 916 if (sound_file_new[snd]) |
3485 | 917 g_free(sound_file_new[snd]); |
1170 | 918 |
919 /* Set it -- and forget it */ | |
3366 | 920 sound_file_new[snd] = g_strdup(file); |
3500 | 921 |
1175 | 922 /* Set our text entry */ |
3366 | 923 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[snd]); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
924 |
1170 | 925 /* Close the window! It's getting cold in here! */ |
926 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
927 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
928 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
929 g_free(last_sound_dir); |
3429 | 930 last_sound_dir = g_dirname(sound_file_new[snd]); |
1170 | 931 } |
932 | |
3366 | 933 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
|
934 { |
1170 | 935 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
936 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
937 if (!sounddialog) { |
1170 | 938 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
939 | |
940 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
941 | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
942 g_snprintf(buf, BUF_LEN - 1, "%s/", last_sound_dir ? last_sound_dir : g_get_home_dir()); |
1170 | 943 |
944 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
945 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
946 gtk_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
947 GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
1170 | 948 |
949 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
3366 | 950 "clicked", GTK_SIGNAL_FUNC(do_select_sound), (int *)sound_row_sel); |
1170 | 951 |
952 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
953 "clicked", GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
1170 | 954 } |
955 | |
956 g_free(buf); | |
957 gtk_widget_show(sounddialog); | |
958 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
959 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
960 |
3366 | 961 |
962 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
963 GtkTreeIter iter; | |
964 GValue val = { 0, }; | |
3500 | 965 |
3366 | 966 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
967 return; | |
968 gtk_tree_model_get_value (model, &iter, 2, &val); | |
969 sound_row_sel = g_value_get_uint(&val); | |
970 if (sound_entry) | |
3374 | 971 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[sound_row_sel] ? sound_file_new[sound_row_sel] : "(default)"); |
3366 | 972 g_value_unset (&val); |
973 if (sounddialog) | |
974 gtk_widget_destroy(sounddialog); | |
975 } | |
976 | |
977 GtkWidget *sound_events_page() { | |
978 | |
979 GtkWidget *ret; | |
980 GtkWidget *sw; | |
981 GtkWidget *button, *hbox; | |
982 GtkTreeIter iter; | |
983 GtkWidget *event_view; | |
984 GtkListStore *event_store; | |
985 GtkCellRenderer *rend; | |
986 GtkTreeViewColumn *col; | |
987 GtkTreeSelection *sel; | |
988 GtkTreePath *path; | |
989 int j; | |
990 | |
3427 | 991 ret = gtk_vbox_new(FALSE, 18); |
992 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 993 |
994 sw = gtk_scrolled_window_new(NULL,NULL); | |
995 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3427 | 996 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 997 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
998 | |
999 for (j=0; j < NUM_SOUNDS; j++) { | |
1000 if (sounds[j].opt == 0) | |
1001 continue; | |
3500 | 1002 |
3366 | 1003 gtk_list_store_append (event_store, &iter); |
1004 gtk_list_store_set(event_store, &iter, | |
1005 0, sound_options & sounds[j].opt, | |
3500 | 1006 1, sounds[j].label, |
3366 | 1007 2, j, -1); |
1008 } | |
1009 | |
1010 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
3500 | 1011 |
3366 | 1012 rend = gtk_cell_renderer_toggle_new(); |
1013 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1014 g_signal_connect (G_OBJECT (sel), "changed", | |
1015 G_CALLBACK (prefs_sound_sel), | |
1016 NULL); | |
1017 g_signal_connect (G_OBJECT(rend), "toggled", | |
1018 G_CALLBACK(event_toggled), event_store); | |
1019 path = gtk_tree_path_new_first(); | |
1020 gtk_tree_selection_select_path(sel, path); | |
3500 | 1021 |
3366 | 1022 col = gtk_tree_view_column_new_with_attributes ("Play", |
1023 rend, | |
1024 "active", 0, | |
1025 NULL); | |
1026 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1027 | |
1028 rend = gtk_cell_renderer_text_new(); | |
1029 col = gtk_tree_view_column_new_with_attributes ("Event", | |
1030 rend, | |
1031 "text", 1, | |
1032 NULL); | |
1033 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
3500 | 1034 g_object_unref(G_OBJECT(event_store)); |
3366 | 1035 gtk_container_add(GTK_CONTAINER(sw), event_view); |
1036 | |
3427 | 1037 hbox = gtk_hbox_new(FALSE, 6); |
1038 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1039 sound_entry = gtk_entry_new(); |
1040 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[0] ? sound_file_new[0] : "(default)"); | |
1041 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); | |
1042 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
|
1043 |
3025 | 1044 button = gtk_button_new_with_label(_("Test")); |
3366 | 1045 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(test_sound), NULL); |
1046 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
|
1047 |
1175 | 1048 button = gtk_button_new_with_label(_("Reset")); |
3366 | 1049 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(reset_sound), NULL); |
1050 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1175 | 1051 |
1381 | 1052 button = gtk_button_new_with_label(_("Choose...")); |
3366 | 1053 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(sel_sound), NULL); |
1054 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
3500 | 1055 |
3427 | 1056 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1057 |
3366 | 1058 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1059 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1060 |
3366 | 1061 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1062 { |
3366 | 1063 GtkTreeIter iter; |
1064 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1065 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1066 char *tmp; |
3374 | 1067 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1068 |
3366 | 1069 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1070 return; | |
1071 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1072 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1073 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1074 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1075 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1076 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
|
1077 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1078 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
|
1079 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1080 g_free(tmp); |
3366 | 1081 g_value_unset (&val); |
3500 | 1082 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1083 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1084 |
3500 | 1085 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
3366 | 1086 struct away_message *am; |
1087 GtkTreeIter iter; | |
1088 GtkTreePath *path; | |
1089 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
1090 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1091 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1092 GValue val = { 0, }; |
3500 | 1093 |
3379 | 1094 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1095 return; |
3379 | 1096 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1097 am = g_value_get_pointer (&val); |
1098 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1099 rem_away_mess(NULL, am); | |
3379 | 1100 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter); |
1101 path = gtk_tree_path_new_first(); | |
3366 | 1102 gtk_tree_selection_select_path(sel, path); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1103 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1104 |
3366 | 1105 GtkWidget *away_message_page() { |
1106 GtkWidget *ret; | |
3427 | 1107 GtkWidget *hbox; |
3379 | 1108 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1109 GtkWidget *sw; |
3366 | 1110 GtkTreeIter iter; |
1111 GtkWidget *event_view; | |
1112 GtkCellRenderer *rend; | |
1113 GtkTreeViewColumn *col; | |
1114 GtkTreeSelection *sel; | |
1115 GtkTreePath *path; | |
940 | 1116 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1117 struct away_message *a; |
3366 | 1118 GtkWidget *sw2; |
3427 | 1119 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1120 |
3427 | 1121 ret = gtk_vbox_new(FALSE, 18); |
1122 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1123 | |
1124 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
3500 | 1125 |
3366 | 1126 sw = gtk_scrolled_window_new(NULL,NULL); |
1127 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1128 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3379 | 1129 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), |
1130 GTK_SHADOW_IN); | |
3427 | 1131 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3500 | 1132 |
3374 | 1133 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1134 while (awy) { |
1135 a = (struct away_message *)awy->data; | |
1136 gtk_list_store_append (prefs_away_store, &iter); | |
1137 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1138 0, a->name, |
1139 1, a, -1); | |
3366 | 1140 awy = awy->next; |
1141 } | |
1142 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
|
1143 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1144 |
3366 | 1145 rend = gtk_cell_renderer_text_new(); |
1146 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1147 rend, | |
1148 "text", 0, | |
1149 NULL); | |
1150 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1151 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1152 gtk_widget_show(event_view); | |
3427 | 1153 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1154 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1155 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1156 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1157 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1158 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3500 | 1159 |
3427 | 1160 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1161 GTK_LAYOUT(away_text)->hadjustment->step_increment = 10.0; |
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1162 GTK_LAYOUT(away_text)->vadjustment->step_increment = 10.0; |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1163 gaim_setup_imhtml(away_text); |
3366 | 1164 gtk_imhtml_set_defaults(GTK_IMHTML(away_text), NULL, NULL, NULL); |
1165 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1166 path = gtk_tree_path_new_first(); | |
1167 g_signal_connect (G_OBJECT (sel), "changed", | |
1168 G_CALLBACK (away_message_sel), | |
1169 NULL); | |
1170 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1171 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1172 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1173 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1174 gtk_size_group_add_widget(sg, button); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1175 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); |
3472 | 1176 |
3366 | 1177 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1178 gtk_size_group_add_widget(sg, button); |
3366 | 1179 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), event_view); |
3472 | 1180 |
3366 | 1181 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1182 |
3366 | 1183 button = pixbuf_button(_("_Edit"), "edit.png"); |
3427 | 1184 gtk_size_group_add_widget(sg, button); |
3374 | 1185 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), event_view); |
3366 | 1186 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1187 |
3427 | 1188 gtk_widget_show_all(ret); |
3366 | 1189 return ret; |
1190 } | |
3472 | 1191 |
3500 | 1192 GtkTreeIter *prefs_notebook_add_page(char *text, |
1193 GdkPixbuf *pixbuf, | |
1194 GtkWidget *page, | |
3366 | 1195 GtkTreeIter *iter, |
3500 | 1196 GtkTreeIter *parent, |
3366 | 1197 int ind) { |
1198 GdkPixbuf *icon = NULL; | |
3500 | 1199 |
3366 | 1200 if (pixbuf) |
3500 | 1201 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
|
1202 |
3366 | 1203 gtk_tree_store_append (prefstree, iter, parent); |
1204 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1205 |
3366 | 1206 if (pixbuf) |
1207 g_object_unref(pixbuf); | |
1208 if (icon) | |
1209 g_object_unref(icon); | |
1210 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1211 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1212 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1213 |
3366 | 1214 void prefs_notebook_init() { |
1215 int a = 0; | |
1216 GtkTreeIter p, c; | |
3373 | 1217 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, a++); |
1218 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, a++); | |
1219 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, a++); | |
1220 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, a++); | |
1221 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, a++); | |
1222 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, a++); | |
1223 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, a++); | |
1224 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, a++); | |
1225 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, a++); | |
1226 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, a++); | |
1130
d31fad9abb32
[gaim-migrate @ 1140]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1125
diff
changeset
|
1227 |
3373 | 1228 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, a++); |
1229 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, a++); | |
1230 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, a++); | |
1231 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, a++); | |
1232 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, a++); | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1233 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1234 |
3500 | 1235 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1236 { |
3366 | 1237 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1238 GtkWidget *hbox; |
3366 | 1239 GtkWidget *frame; |
1240 GtkWidget *tree_v; | |
1241 GtkTreeViewColumn *column; | |
1242 GtkCellRenderer *cell; | |
1243 GtkTreeSelection *sel; | |
1244 GtkWidget *notebook; | |
1245 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1246 GtkWidget *button; |
3500 | 1247 |
3366 | 1248 int r; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1249 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1250 if (prefs) { |
3472 | 1251 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1252 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1253 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1254 |
3366 | 1255 /* copy the preferences to tmp values... |
1256 * I liked "take affect immediately" Oh well :-( */ | |
1257 misc_options_new = misc_options; | |
1258 logging_options_new = logging_options; | |
1259 blist_options_new = blist_options; | |
1260 convo_options_new = convo_options; | |
1261 im_options_new = im_options; | |
1262 chat_options_new = chat_options; | |
1263 font_options_new = font_options; | |
1264 sound_options_new = sound_options; | |
1265 for (r = 0; r < NUM_SOUNDS; r++) | |
1266 sound_file_new[r] = g_strdup(sound_file[r]); | |
1267 away_options_new = away_options; | |
1268 away_resend_new = away_resend; | |
1269 report_idle_new = report_idle; | |
1270 auto_away_new = auto_away; | |
1271 default_away_new = default_away; | |
1272 fontsize_new = fontsize; | |
1273 web_browser_new = web_browser; | |
1274 proxytype_new = proxytype; | |
1275 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", sound_cmd); | |
3500 | 1276 g_snprintf(web_command_new, sizeof(web_command_new), "%s", |
3434 | 1277 web_command ? web_command : "xterm -e lynx %%s"); |
3366 | 1278 g_snprintf(fontface_new, sizeof(fontface_new), fontface); |
1279 memcpy(&conv_size_new, &conv_size, sizeof(struct window_size)); | |
3500 | 1280 memcpy(&buddy_chat_size_new, &buddy_chat_size, sizeof(struct window_size)); |
3366 | 1281 memcpy(&fgcolor_new, &fgcolor, sizeof(GdkColor)); |
1282 memcpy(&bgcolor_new, &bgcolor, sizeof(GdkColor)); | |
3500 | 1283 |
3366 | 1284 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1285 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
905 | 1286 gtk_window_set_wmclass(GTK_WINDOW(prefs), "preferences", "Gaim"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1287 gtk_widget_realize(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1288 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
3366 | 1289 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1290 gtk_signal_connect(GTK_OBJECT(prefs), "destroy", GTK_SIGNAL_FUNC(delete_prefs), NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1291 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1292 vbox = gtk_vbox_new(FALSE, 5); |
1185 | 1293 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1294 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1295 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1296 |
3366 | 1297 hbox = gtk_hbox_new (FALSE, 6); |
1298 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1299 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1300 gtk_widget_show (hbox); | |
1301 | |
1302 frame = gtk_frame_new (NULL); | |
1303 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1304 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1305 gtk_widget_show (frame); | |
3500 | 1306 |
3366 | 1307 /* The tree -- much inspired by the Gimp */ |
1308 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1309 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1310 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1311 | |
1312 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1313 gtk_widget_show(tree_v); | |
1314 /* icons */ | |
1315 cell = gtk_cell_renderer_pixbuf_new (); | |
1316 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
3500 | 1317 |
3366 | 1318 /* text */ |
1319 cell = gtk_cell_renderer_text_new (); | |
1320 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1321 |
3366 | 1322 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
|
1323 |
3472 | 1324 /* The right side */ |
1325 frame = gtk_frame_new (NULL); | |
1326 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1327 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1328 gtk_widget_show (frame); | |
3500 | 1329 |
3472 | 1330 vbox2 = gtk_vbox_new (FALSE, 4); |
1331 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1332 gtk_widget_show (vbox2); | |
3500 | 1333 |
3472 | 1334 frame = gtk_frame_new (NULL); |
1335 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1336 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1337 gtk_widget_show (frame); | |
3500 | 1338 |
3472 | 1339 hbox = gtk_hbox_new (FALSE, 4); |
1340 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1341 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1342 gtk_widget_show (hbox); | |
3500 | 1343 |
3472 | 1344 preflabel = gtk_label_new(NULL); |
1345 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1346 gtk_widget_show (preflabel); | |
3500 | 1347 |
3472 | 1348 /* The notebook */ |
1349 prefsnotebook = notebook = gtk_notebook_new (); | |
1350 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1351 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1352 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
|
1353 |
3472 | 1354 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1355 g_signal_connect (G_OBJECT (sel), "changed", | |
1356 G_CALLBACK (pref_nb_select), | |
1357 notebook); | |
3500 | 1358 gtk_widget_show(notebook); |
3472 | 1359 sep = gtk_hseparator_new(); |
1360 gtk_widget_show(sep); | |
1361 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1362 |
3472 | 1363 /* The buttons to press! */ |
1364 hbox = gtk_hbox_new (FALSE, 6); | |
1365 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1366 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1367 gtk_widget_show (hbox); |
3377 | 1368 |
3472 | 1369 button = gtk_button_new_from_stock (GTK_STOCK_OK); |
3500 | 1370 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_cb), prefs); |
3472 | 1371 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1372 gtk_widget_show(button); | |
3377 | 1373 |
3472 | 1374 button = gtk_button_new_from_stock (GTK_STOCK_APPLY); |
3500 | 1375 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(apply_cb), prefs); |
3472 | 1376 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1377 gtk_widget_show(button); | |
3500 | 1378 |
3472 | 1379 button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); |
1380 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), prefs); | |
1381 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1382 gtk_widget_show(button); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1383 |
3500 | 1384 prefs_notebook_init(); |
3427 | 1385 |
3472 | 1386 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1387 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1388 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1389 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1390 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1391 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1392 if (debugbutton) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1393 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1394 if (misc_options & OPT_MISC_DEBUG) { |
3500 | 1395 misc_options_new ^= OPT_MISC_DEBUG; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1396 misc_options ^= OPT_MISC_DEBUG; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1397 save_prefs(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1398 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1399 g_free(dw); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1400 dw = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1401 return FALSE; |
1 | 1402 |
1403 } | |
1404 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1405 static void build_debug() |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1406 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1407 GtkWidget *scroll; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1408 GtkWidget *box; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1409 if (!dw) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1410 dw = g_new0(struct debug_window, 1); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1411 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1412 GAIM_DIALOG(dw->window); |
2536
0e0a54e5819a
[gaim-migrate @ 2549]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2471
diff
changeset
|
1413 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim debug output window")); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1414 gtk_window_set_wmclass(GTK_WINDOW(dw->window), "debug_out", "Gaim"); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1415 gtk_signal_connect(GTK_OBJECT(dw->window), "delete_event", GTK_SIGNAL_FUNC(debug_delete), NULL); |
2547
ab55ac6234b8
[gaim-migrate @ 2560]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2536
diff
changeset
|
1416 gtk_widget_realize(dw->window); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1417 |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1418 box = gtk_hbox_new(FALSE, 0); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1419 gtk_container_add(GTK_CONTAINER(dw->window), box); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1420 gtk_widget_show(box); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1421 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1422 dw->entry = gtk_text_new(NULL, NULL); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1423 gtk_text_set_word_wrap(GTK_TEXT(dw->entry), TRUE); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1424 gtk_text_set_editable(GTK_TEXT(dw->entry), FALSE); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1425 gtk_container_add(GTK_CONTAINER(box), dw->entry); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1426 gtk_widget_set_usize(dw->entry, 500, 200); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1427 gtk_widget_show(dw->entry); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1428 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1429 scroll = gtk_vscrollbar_new(GTK_TEXT(dw->entry)->vadj); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1430 gtk_box_pack_start(GTK_BOX(box), scroll, FALSE, FALSE, 0); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1431 gtk_widget_show(scroll); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1432 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1433 gtk_widget_show(dw->window); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1434 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1435 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1436 void show_debug() |
1 | 1437 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1438 if ((misc_options & OPT_MISC_DEBUG)) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1439 if (!dw || !dw->window) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1440 build_debug(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1441 gtk_widget_show(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1442 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1443 if (!dw) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1444 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1445 gtk_widget_destroy(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1446 dw->window = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1447 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1448 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1449 |
970 | 1450 void debug_printf(char *fmt, ...) |
1451 { | |
1452 va_list ap; | |
1453 gchar *s; | |
1454 | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1455 va_start(ap, fmt); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1456 s = g_strdup_vprintf(fmt, ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1457 va_end(ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1458 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1459 if (misc_options & OPT_MISC_DEBUG && dw) { |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1460 GtkAdjustment *adj = GTK_TEXT(dw->entry)->vadj; |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1461 gboolean scroll = (adj->value == adj->upper - adj->lower - adj->page_size); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1462 |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1463 gtk_text_freeze(GTK_TEXT(dw->entry)); |
970 | 1464 gtk_text_insert(GTK_TEXT(dw->entry), NULL, NULL, NULL, s, -1); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1465 gtk_text_thaw(GTK_TEXT(dw->entry)); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1466 |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1467 if (scroll) |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1468 gtk_adjustment_set_value(adj, adj->upper - adj->lower - adj->page_size); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1469 } |
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1470 if (opt_debug) |
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1471 g_print("%s", s); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1472 g_free(s); |
970 | 1473 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1474 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1475 |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
1476 |
3500 | 1477 |
1478 | |
1479 | |
1 | 1480 void set_option(GtkWidget *w, int *option) |
1481 { | |
1482 *option = !(*option); | |
1483 } | |
1484 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1485 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1486 { |
3500 | 1487 misc_options_new ^= option; |
1488 | |
1489 /* gross hack because we don't want to save all prefs just because | |
1490 * we enabled the debug window. then again, what about the debug | |
1491 * window _isn't_ an ugly hack? */ | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1492 |
3500 | 1493 if (option == OPT_MISC_DEBUG) { |
1494 misc_options ^= option; | |
1495 save_prefs(); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1496 show_debug(); |
3500 | 1497 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1498 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1499 |
3366 | 1500 |
1501 /* Functions for each _options variable that sees what's changed, and makes | |
1502 * effective those changes that take place immediately (UI stuff) */ | |
1503 static void set_misc_options() | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1504 { |
3500 | 1505 |
1506 /* int option = misc_options ^ misc_options_new; */ | |
3366 | 1507 misc_options = misc_options_new; |
3500 | 1508 |
3366 | 1509 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1510 |
3366 | 1511 static void set_logging_options() |
1512 { | |
1513 int option = logging_options ^ logging_options_new; | |
1514 logging_options = logging_options_new; | |
3500 | 1515 |
3457 | 1516 if (option & OPT_LOG_CONVOS || option & OPT_LOG_CHATS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1517 update_log_convs(); |
1773 | 1518 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1519 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1520 |
3366 | 1521 static void set_blist_options() |
1 | 1522 { |
3366 | 1523 int option = blist_options ^ blist_options_new; |
1524 blist_options = blist_options_new; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1525 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1526 if (!blist) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1527 return; |
3500 | 1528 |
3366 | 1529 if (option & OPT_BLIST_BOTTOM_TAB) |
1530 set_blist_tab(); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1531 |
3366 | 1532 if (option & OPT_BLIST_NO_BUTTONS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1533 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1534 |
3366 | 1535 if (option & OPT_BLIST_SHOW_GRPNUM) |
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1536 update_num_groups(); |
9 | 1537 |
3366 | 1538 if (option & OPT_BLIST_NO_MT_GRP) |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1539 toggle_show_empty_groups(); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1540 |
3366 | 1541 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
|
1542 update_button_pix(); |
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1543 |
3366 | 1544 if (option & OPT_BLIST_SHOW_PIXMAPS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1545 toggle_buddy_pixmaps(); |
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1546 |
3366 | 1547 if ((option & OPT_BLIST_GREY_IDLERS) || (option & OPT_BLIST_SHOW_IDLETIME)) |
2594 | 1548 update_idle_times(); |
3032 | 1549 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1550 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1551 |
3366 | 1552 static void set_convo_options() |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1553 { |
3366 | 1554 int option = convo_options ^ convo_options_new; |
1555 convo_options = convo_options_new; | |
3500 | 1556 |
1557 if (option & OPT_CONVO_SHOW_SMILEY) | |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1558 toggle_smileys(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1559 |
3366 | 1560 if (option & OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1561 toggle_timestamps(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1562 |
3366 | 1563 if (option & OPT_CONVO_CHECK_SPELLING) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1564 toggle_spellchk(); |
572
faca21605e1b
[gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
1565 |
3366 | 1566 if (option & OPT_CONVO_COMBINE) { |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1567 /* (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB) == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB) */ |
3500 | 1568 |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1569 } |
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1570 |
1 | 1571 } |
1572 | |
3366 | 1573 static void set_im_options() |
1 | 1574 { |
3366 | 1575 int option = im_options ^ im_options_new; |
1576 im_options = im_options_new; | |
3500 | 1577 |
3366 | 1578 if (option & OPT_IM_ONE_WINDOW) |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1579 im_tabize(); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1580 |
3366 | 1581 if (option & OPT_IM_SIDE_TAB || option & OPT_IM_BR_TAB) |
1582 update_im_tabs(); | |
1583 | |
1584 if (option & OPT_IM_HIDE_ICONS) | |
2323
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2322
diff
changeset
|
1585 set_hide_icons(); |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2322
diff
changeset
|
1586 |
3366 | 1587 if (option & OPT_IM_ALIAS_TAB) |
2787
feea7103a235
[gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2760
diff
changeset
|
1588 set_convo_titles(); |
feea7103a235
[gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2760
diff
changeset
|
1589 |
3366 | 1590 if (option & OPT_IM_NO_ANIMATION) |
3013 | 1591 set_anim(); |
3500 | 1592 |
3366 | 1593 if (option & OPT_IM_BUTTON_TEXT || option & OPT_IM_BUTTON_XPM) |
3500 | 1594 update_im_button_pix(); |
1 | 1595 } |
1596 | |
3366 | 1597 static void set_chat_options() |
1 | 1598 { |
3366 | 1599 int option = chat_options ^ chat_options_new; |
1600 chat_options = chat_options_new; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1601 |
3366 | 1602 if (option & OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1603 chat_tabize(); |
3500 | 1604 |
3366 | 1605 if (option & OPT_CHAT_BUTTON_TEXT || option & OPT_CHAT_BUTTON_XPM) |
3500 | 1606 update_chat_button_pix(); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1607 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1608 |
3366 | 1609 void set_sound_options() |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1610 { |
3366 | 1611 /* int option = sound_options ^ sound_options_new; */ |
1612 sound_options = sound_options_new; | |
3500 | 1613 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1614 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1615 |
3366 | 1616 static void set_font_options() |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1617 { |
3366 | 1618 /* int option = font_options ^ font_options_new; */ |
1619 font_options = font_options_new; | |
3500 | 1620 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1621 update_font_buttons(); |
1 | 1622 } |
1623 | |
3366 | 1624 static void set_away_options() |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1625 { |
3500 | 1626 int option = away_options ^ away_options_new; |
3366 | 1627 away_options = away_options_new; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1628 |
3366 | 1629 if (option & OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1630 toggle_away_queue(); |
3366 | 1631 } |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1632 |
3366 | 1633 static void toggle_option(GtkWidget *w, int option) { |
1634 int *o = gtk_object_get_user_data(GTK_OBJECT(w)); | |
1635 *o ^= option; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1636 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1637 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1638 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 1639 { |
1640 GtkWidget *button; | |
3427 | 1641 button = gtk_check_button_new_with_mnemonic(text); |
1 | 1642 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
1643 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
3366 | 1644 gtk_object_set_user_data(GTK_OBJECT(button), options); |
1 | 1645 |
3391 | 1646 /* So that the debug window happens immediately |
1647 * I don't think it should be "preferences," anyway. */ | |
3500 | 1648 if (options == &misc_options_new && option == OPT_MISC_DEBUG) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1649 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_misc_option), |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1650 (int *)option); |
3366 | 1651 else |
1652 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_option), | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1653 (int *)option); |
3500 | 1654 |
1 | 1655 gtk_widget_show(button); |
1656 | |
1657 return button; | |
1658 } | |
1659 | |
3366 | 1660 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
1661 {} | |
1662 void default_away_menu_init(GtkWidget *omenu) | |
3032 | 1663 { |
3366 | 1664 GtkWidget *menu, *opt; |
1665 int index = 0; | |
1666 GSList *awy = away_messages; | |
1667 struct away_message *a; | |
1668 | |
1669 menu = gtk_menu_new(); | |
1670 | |
1671 while (awy) { | |
1672 a = (struct away_message *)awy->data; | |
1673 opt = gtk_menu_item_new_with_label(a->name); | |
1674 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_default_away), | |
1675 (gpointer)index); | |
1676 gtk_widget_show(opt); | |
1677 gtk_menu_append(GTK_MENU(menu), opt); | |
1678 | |
1679 awy = awy->next; | |
1680 index++; | |
1681 } | |
1682 | |
1683 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
1684 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
1685 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
1686 } | |
1687 | |
1688 GtkWidget *pref_fg_picture = NULL; | |
1689 GtkWidget *pref_bg_picture = NULL; | |
1690 | |
1691 void destroy_colorsel(GtkWidget *w, gpointer d) | |
1692 { | |
1693 if (d) { | |
1694 gtk_widget_destroy(fgcseld); | |
1695 fgcseld = NULL; | |
1696 } else { | |
1697 gtk_widget_destroy(bgcseld); | |
1698 bgcseld = NULL; | |
1699 } | |
3032 | 1700 } |
1701 | |
3366 | 1702 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 1703 { |
3366 | 1704 if ((int)d == 1) { |
1705 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1706 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3366 | 1707 &fgcolor_new); |
1708 destroy_colorsel(NULL, (void *)1); | |
1709 update_color(NULL, pref_fg_picture); | |
1710 } else { | |
1711 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1712 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3366 | 1713 &bgcolor_new); |
1714 destroy_colorsel(NULL, (void *)0); | |
1715 update_color(NULL, pref_bg_picture); | |
1716 } | |
3032 | 1717 } |
1718 | |
3366 | 1719 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 1720 { |
3366 | 1721 GdkColor c; |
1722 GtkStyle *style; | |
1723 c.pixel = 0; | |
3500 | 1724 |
3366 | 1725 if (pic == pref_fg_picture) { |
1726 if (font_options_new & OPT_FONT_FGCOL) { | |
1727 c.red = fgcolor_new.red; | |
1728 c.blue = fgcolor_new.blue; | |
1729 c.green = fgcolor_new.green; | |
1730 } else { | |
1731 c.red = 0; | |
1732 c.blue = 0; | |
1733 c.green = 0; | |
1734 } | |
1735 } else { | |
1736 if (font_options_new & OPT_FONT_BGCOL) { | |
1737 c.red = bgcolor_new.red; | |
1738 c.blue = bgcolor_new.blue; | |
1739 c.green = bgcolor_new.green; | |
1740 } else { | |
1741 c.red = 0xffff; | |
1742 c.blue = 0xffff; | |
1743 c.green = 0xffff; | |
1744 } | |
1745 } | |
1746 | |
1747 style = gtk_style_new(); | |
1748 style->bg[0] = c; | |
1749 gtk_widget_set_style(pic, style); | |
1750 gtk_style_unref(style); | |
1751 } | |
1752 void set_default_away(GtkWidget *w, gpointer i) | |
1753 { | |
1754 | |
1755 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1756 |
3366 | 1757 if (away_messages == NULL) |
1758 default_away_new = NULL; | |
1759 else if ((int)i >= length) | |
1760 default_away_new = g_slist_nth_data(away_messages, length - 1); | |
1761 else | |
1762 default_away_new = g_slist_nth_data(away_messages, (int)i); | |
1763 } | |
3500 | 1764 |
3366 | 1765 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
1766 { | |
1767 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
1768 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
1769 } | |
3427 | 1770 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 1771 { |
1772 GtkWidget *hbox; | |
1773 GtkWidget *label; | |
1774 GtkWidget *spin; | |
1775 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
1776 |
3366 | 1777 hbox = gtk_hbox_new(FALSE, 5); |
1778 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
1779 gtk_widget_show(hbox); | |
1780 | |
3427 | 1781 label = gtk_label_new_with_mnemonic(title); |
3366 | 1782 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1783 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
1784 |
3366 | 1785 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
1786 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
1787 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
1788 gtk_widget_set_usize(spin, 50, -1); | |
1789 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
1790 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed", | |
1791 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin)); | |
1792 gtk_widget_show(spin); | |
3500 | 1793 |
3427 | 1794 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
1795 | |
1796 if (sg) { | |
1797 gtk_size_group_add_widget(sg, label); | |
1798 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 1799 |
3427 | 1800 } |
1801 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1802 } |
1 | 1803 |
3366 | 1804 void dropdown_set(GtkObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1805 { |
3366 | 1806 int opt = (int)gtk_object_get_user_data(w); |
1807 int clear = (int)gtk_object_get_data(w, "clear"); | |
3500 | 1808 |
3366 | 1809 if (clear != -1) { |
1810 *option = *option & ~clear; | |
1811 *option = *option | opt; | |
1812 } else { | |
1813 debug_printf("HELLO %d\n", opt); | |
1814 *option = opt; | |
1815 } | |
3500 | 1816 |
3366 | 1817 if (option == &proxytype_new) { |
1818 if (opt == PROXY_NONE) | |
1819 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
1820 else | |
1821 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
1822 } else if (option == &web_browser_new) { | |
1823 if (opt == BROWSER_MANUAL) | |
1824 gtk_widget_set_sensitive(browser_entry, TRUE); | |
1825 else | |
1826 gtk_widget_set_sensitive(browser_entry, FALSE); | |
3379 | 1827 } else if (*option == sound_options_new) { |
3366 | 1828 if (opt == OPT_SOUND_CMD) |
1829 gtk_widget_set_sensitive(sndcmd, TRUE); | |
1830 else | |
1831 gtk_widget_set_sensitive(sndcmd, FALSE); | |
1832 } | |
3500 | 1833 |
1 | 1834 } |
1835 | |
3500 | 1836 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 1837 { |
3366 | 1838 va_list menuitems; |
1839 GtkWidget *dropdown, *opt, *menu; | |
1840 GtkWidget *label; | |
1841 gchar *text; | |
1842 int value; | |
1843 int o = 0; | |
1844 GtkWidget *hbox; | |
1 | 1845 |
3366 | 1846 hbox = gtk_hbox_new(FALSE, 5); |
1847 gtk_container_add (GTK_CONTAINER (box), hbox); | |
1848 gtk_widget_show(hbox); | |
1849 | |
3427 | 1850 label = gtk_label_new_with_mnemonic(title); |
3366 | 1851 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1852 gtk_widget_show(label); | |
1853 | |
1854 va_start(menuitems, clear); | |
1855 text = va_arg(menuitems, gchar *); | |
1856 | |
1857 if (!text) | |
1858 return NULL; | |
3500 | 1859 |
3366 | 1860 dropdown = gtk_option_menu_new(); |
1861 menu = gtk_menu_new(); | |
3500 | 1862 |
3427 | 1863 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 1864 |
3366 | 1865 while (text) { |
1866 value = va_arg(menuitems, int); | |
1867 opt = gtk_menu_item_new_with_label(text); | |
1868 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
1869 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
1870 gtk_signal_connect(GTK_OBJECT(opt), "activate", | |
1871 GTK_SIGNAL_FUNC(dropdown_set), (void *)option); | |
1872 gtk_widget_show(opt); | |
1873 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 1874 |
3366 | 1875 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
1876 gtk_menu_set_active(GTK_MENU(menu), o); | |
1877 } | |
1878 text = va_arg(menuitems, gchar *); | |
1879 o++; | |
1880 } | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1881 |
3366 | 1882 va_end(menuitems); |
1 | 1883 |
3500 | 1884 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 1885 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
1886 gtk_widget_show(dropdown); | |
3427 | 1887 return label; |
3500 | 1888 } |
1889 | |
3366 | 1890 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 1891 { |
3366 | 1892 /* more stuff stolen from X-Chat */ |
1893 GtkWidget *swid; | |
1894 GdkColor c; | |
1895 GtkStyle *style; | |
1896 c.pixel = 0; | |
1897 if (fgc) { | |
1898 if (font_options_new & OPT_FONT_FGCOL) { | |
1899 c.red = fgcolor_new.red; | |
1900 c.blue = fgcolor_new.blue; | |
1901 c.green = fgcolor_new.green; | |
1902 } else { | |
1903 c.red = 0; | |
1904 c.blue = 0; | |
1905 c.green = 0; | |
1906 } | |
1907 } else { | |
1908 if (font_options_new & OPT_FONT_BGCOL) { | |
1909 c.red = bgcolor_new.red; | |
1910 c.blue = bgcolor_new.blue; | |
1911 c.green = bgcolor_new.green; | |
1912 } else { | |
1913 c.red = 0xffff; | |
1914 c.blue = 0xffff; | |
1915 c.green = 0xffff; | |
1916 } | |
1917 } | |
1 | 1918 |
3366 | 1919 style = gtk_style_new(); |
1920 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1921 |
3366 | 1922 swid = gtk_event_box_new(); |
1923 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
1924 gtk_style_unref(style); | |
1925 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); | |
1926 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
1927 gtk_widget_show(swid); | |
1928 return swid; | |
1 | 1929 } |
3366 | 1930 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1931 { |
3366 | 1932 int i = 0; |
1933 char *fontname; | |
1934 | |
3473 | 1935 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 1936 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1937 |
3500 | 1938 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface_new)) { |
3366 | 1939 fontface_new[i] = fontname[i]; |
1940 i++; | |
1941 } | |
3473 | 1942 fontface_new[i] = 0; |
1943 debug_printf("fontface_new: %s\n", fontface_new); | |
3366 | 1944 g_free(fontname); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1945 } |
3500 | 1946 |