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