Mercurial > pidgin
annotate src/prefs.c @ 3457:222e23f91092
[gaim-migrate @ 3505]
Deryni made it so we can all log chats and IMs seperately.
He had it retain your old option--it would log both if you had
it configured that way.
I made it so that if you had logging on it will log IMs--but you'll have to
turn on logging chats manually. So if you want to log chats, turn that on.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 28 Aug 2002 05:55:48 +0000 |
parents | 0c281a80767d |
children | 7a3f16a375a5 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
1 | 5 * |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 | |
28 #include <sys/types.h> | |
29 #include <sys/stat.h> | |
30 | |
31 #include <unistd.h> | |
32 #include <stdio.h> | |
33 #include <stdlib.h> | |
970 | 34 #include <stdarg.h> |
3379 | 35 #include <ctype.h> |
1 | 36 #include <gtk/gtk.h> |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
1 | 38 #include "gaim.h" |
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
39 #include "prpl.h" |
3366 | 40 #include "proxy.h" |
41 | |
42 /* 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++) { | |
3433 | 121 if (sound_file_new[v] && (sound_file_new[v] != sound_file[v])) |
3366 | 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 |
3432 | 655 static void browser_print_option(GtkEntry *entry, void *nullish) { |
656 g_snprintf(web_command_new, sizeof(web_command_new), "%s", gtk_entry_get_text(entry)); | |
657 } | |
658 | |
3366 | 659 GtkWidget *browser_page() { |
660 GtkWidget *ret; | |
661 GtkWidget *vbox, *hbox; | |
662 GtkWidget *label; | |
3427 | 663 GtkSizeGroup *sg; |
664 | |
665 ret = gtk_vbox_new(FALSE, 18); | |
666 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
667 | |
668 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
669 |
3427 | 670 vbox = make_frame (ret, _("Browser Selection")); |
671 label = gaim_dropdown(vbox, "_Browser", &web_browser_new, -1, | |
672 "Netscape", BROWSER_NETSCAPE, | |
673 "Konqueror", BROWSER_KONQ, | |
674 "Mozilla", BROWSER_MOZILLA, | |
675 "Manual", BROWSER_MANUAL, | |
676 "Galeon", BROWSER_GALEON, | |
677 "Opera", BROWSER_OPERA, NULL); | |
678 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
679 gtk_size_group_add_widget(sg, label); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
680 |
3366 | 681 hbox = gtk_hbox_new(FALSE, 5); |
682 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
3427 | 683 label = gtk_label_new_with_mnemonic("_Manual: "); |
3366 | 684 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 685 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
686 gtk_size_group_add_widget(sg, label); | |
3366 | 687 browser_entry = gtk_entry_new(); |
3427 | 688 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3366 | 689 if (web_browser_new != BROWSER_MANUAL) |
690 gtk_widget_set_sensitive(browser_entry, FALSE); | |
691 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
|
692 |
3432 | 693 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command_new); |
694 gtk_signal_connect(GTK_OBJECT(browser_entry), "changed", | |
695 GTK_SIGNAL_FUNC(browser_print_option), NULL); | |
696 | |
3427 | 697 vbox = make_frame (ret, _("Browser Options")); |
698 gaim_button(_("Open new _window by default"), &misc_options_new, OPT_MISC_BROWSER_POPUP, vbox); | |
3366 | 699 |
3427 | 700 gtk_widget_show_all(ret); |
3366 | 701 return ret; |
702 } | |
703 | |
704 GtkWidget *logging_page() { | |
705 GtkWidget *ret; | |
706 GtkWidget *vbox; | |
3427 | 707 ret = gtk_vbox_new(FALSE, 18); |
708 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
709 |
3427 | 710 vbox = make_frame (ret, _("Message Logs")); |
3457 | 711 gaim_button(_("_Log all Instant Messages"), &logging_options_new, OPT_LOG_CONVOS, vbox); |
712 gaim_button(_("Log all c_hats"), &logging_options_new, OPT_LOG_CHATS, vbox); | |
3427 | 713 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
|
714 |
3427 | 715 vbox = make_frame (ret, _("System Logs")); |
716 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options_new, OPT_LOG_BUDDY_SIGNON, | |
3366 | 717 vbox); |
3427 | 718 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options_new, OPT_LOG_BUDDY_IDLE, |
3366 | 719 vbox); |
3427 | 720 gaim_button(_("Log when buddies go away/come _back"), &logging_options_new, OPT_LOG_BUDDY_AWAY, vbox); |
721 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options_new, OPT_LOG_MY_SIGNON, | |
3366 | 722 vbox); |
3427 | 723 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options_new, |
3366 | 724 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
725 |
3427 | 726 gtk_widget_show_all(ret); |
3366 | 727 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
728 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
729 |
3366 | 730 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
731 |
3366 | 732 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
|
733 { |
3366 | 734 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
735 return TRUE; | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
736 } |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
737 |
3366 | 738 GtkWidget *sound_page() { |
739 GtkWidget *ret; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
740 GtkWidget *label; |
3366 | 741 GtkWidget *vbox, *hbox; |
3427 | 742 GtkSizeGroup *sg; |
743 GtkWidget *dd; | |
3366 | 744 |
3427 | 745 ret = gtk_vbox_new(FALSE, 18); |
746 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
747 |
3427 | 748 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
749 |
3427 | 750 vbox = make_frame (ret, _("Sound Options")); |
751 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); | |
752 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
|
753 |
3427 | 754 vbox = make_frame (ret, _("Sound Method")); |
755 dd = gaim_dropdown(vbox, "_Method", &sound_options_new, OPT_SOUND_BEEP | | |
3366 | 756 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL | |
757 OPT_SOUND_CMD, | |
758 "Console Beep", OPT_SOUND_BEEP, | |
759 #ifdef ESD_SOUND | |
760 "ESD", OPT_SOUND_ESD, | |
761 #endif /* ESD_SOUND */ | |
762 #ifdef ARTSC_SOUND | |
763 "ArtsC", OPT_SOUND_ARTSC, | |
764 #endif /* ARTSC_SOUND */ | |
765 #ifdef NAS_SOUND | |
766 "NAS", OPT_SOUND_NAS, | |
767 #endif /* NAS_SOUND */ | |
768 "Internal", OPT_SOUND_NORMAL, | |
769 "Command", OPT_SOUND_CMD, NULL); | |
3427 | 770 gtk_size_group_add_widget(sg, dd); |
771 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
772 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
773 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
774 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 775 |
3366 | 776 hbox = gtk_hbox_new(FALSE, 5); |
777 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 778 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
779 gtk_size_group_add_widget(sg, label); | |
780 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 781 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
|
782 |
3366 | 783 sndcmd = gtk_entry_new(); |
3427 | 784 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
785 |
3366 | 786 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
787 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
788 gtk_widget_set_size_request(sndcmd, 75, -1); | |
3427 | 789 |
3366 | 790 gtk_widget_set_sensitive(sndcmd, (sound_options_new & OPT_SOUND_CMD)); |
791 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); | |
792 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
|
793 |
3427 | 794 gtk_widget_show_all(ret); |
3366 | 795 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
796 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
797 |
3366 | 798 GtkWidget *away_page() { |
799 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
800 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
801 GtkWidget *hbox; |
3366 | 802 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
803 GtkWidget *button; |
3366 | 804 GtkWidget *select; |
3427 | 805 GtkWidget *dd; |
806 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
807 |
3427 | 808 ret = gtk_vbox_new(FALSE, 18); |
809 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
810 |
3427 | 811 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
812 |
3427 | 813 vbox = make_frame (ret, _("Away")); |
814 gaim_button(_("_Sending messages removes away status"), &away_options_new, OPT_AWAY_BACK_ON_IM, vbox); | |
815 gaim_button(_("_Queue new messages when away"), &away_options_new, OPT_AWAY_QUEUE, vbox); | |
816 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
|
817 |
3427 | 818 vbox = make_frame (ret, _("Auto-response")); |
3366 | 819 hbox = gtk_hbox_new(FALSE, 0); |
820 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 821 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
822 &away_resend_new, 1, 24 * 60 * 60, sg); | |
823 gaim_button(_("_Don't send auto-response"), &away_options_new, OPT_AWAY_NO_AUTO_RESP, vbox); | |
824 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
|
825 |
3366 | 826 if (away_options_new & OPT_AWAY_NO_AUTO_RESP) |
827 gtk_widget_set_sensitive(hbox, FALSE); | |
3427 | 828 |
829 vbox = make_frame (ret, _("Idle")); | |
830 dd = gaim_dropdown(vbox, "Idle _Time Reporting:", &away_resend_new, -1, | |
831 "None", IDLE_NONE, | |
832 "Gaim Usage", IDLE_GAIM, | |
3366 | 833 #ifdef USE_SCREENSAVER |
3427 | 834 "X Usage", IDLE_SCREENSAVER, |
3366 | 835 #endif |
3427 | 836 NULL); |
837 gtk_size_group_add_widget(sg, dd); | |
838 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
839 |
3427 | 840 vbox = make_frame (ret, _("Auto-away")); |
841 button = gaim_button(_("Set away _when idle"), &away_options_new, OPT_AWAY_AUTO, vbox); | |
842 select = gaim_labeled_spin_button(vbox, "_Minutes before setting away:", &auto_away_new, 1, 24 * 60, sg); | |
3366 | 843 if (!(away_options_new & OPT_AWAY_AUTO)) |
844 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); | |
845 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
1 | 846 |
3427 | 847 label = gtk_label_new_with_mnemonic("Away m_essage:"); |
848 gtk_size_group_add_widget(sg, label); | |
849 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 850 hbox = gtk_hbox_new(FALSE, 0); |
851 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
852 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
853 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 854 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3366 | 855 if (!(away_options_new & OPT_AWAY_AUTO)) |
856 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); | |
857 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), prefs_away_menu); | |
858 default_away_menu_init(prefs_away_menu); | |
859 gtk_widget_show(prefs_away_menu); | |
860 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
861 | |
3427 | 862 gtk_widget_show_all(ret); |
3366 | 863 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
864 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
865 |
3366 | 866 #if GTK_CHECK_VERSION (1,3,0) |
867 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
868 { |
3366 | 869 GtkTreeModel *model = (GtkTreeModel *)data; |
870 GtkTreeIter iter; | |
871 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
872 gint soundnum; | |
873 | |
874 gtk_tree_model_get_iter (model, &iter, path); | |
875 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
876 |
3366 | 877 sound_options_new ^= sounds[soundnum].opt; |
878 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options_new & sounds[soundnum].opt, -1); | |
879 } | |
880 #endif | |
881 | |
882 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
883 { | |
884 guint32 tmp_sound = sound_options; | |
3401 | 885 char *save_me=NULL; |
3366 | 886 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) |
887 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
888 if (!(sound_options & sounds[sound_row_sel].opt)) | |
889 sound_options ^= sounds[sound_row_sel].opt; | |
3401 | 890 save_me = sound_file[sound_row_sel]; |
891 sound_file[sound_row_sel] = sound_file_new[sound_row_sel]; | |
3366 | 892 play_sound(sound_row_sel); |
3401 | 893 |
894 sound_file[sound_row_sel] = save_me; | |
3366 | 895 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
896 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
897 |
3366 | 898 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
|
899 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
900 |
3366 | 901 /* This just resets a sound file back to default */ |
902 sound_file_new[sound_row_sel] = NULL; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
903 |
3366 | 904 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
905 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
906 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
907 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 908 { |
909 | |
910 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
911 |
1170 | 912 if (!GTK_IS_WIDGET(w2)) |
913 dest = w; | |
914 else | |
915 dest = w2; | |
916 | |
917 sounddialog = NULL; | |
918 | |
919 gtk_widget_destroy(dest); | |
920 } | |
921 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
922 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
923 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
924 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
925 |
1170 | 926 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
927 | |
928 /* If they type in a directory, change there */ | |
929 if (file_is_dir(file, sounddialog)) | |
930 return; | |
931 | |
932 /* Let's just be safe */ | |
3366 | 933 if (sound_file_new[snd]) |
934 free(sound_file_new[snd]); | |
1170 | 935 |
936 /* Set it -- and forget it */ | |
3366 | 937 sound_file_new[snd] = g_strdup(file); |
938 | |
1175 | 939 /* Set our text entry */ |
3366 | 940 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
|
941 |
1170 | 942 /* Close the window! It's getting cold in here! */ |
943 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
944 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
945 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
946 g_free(last_sound_dir); |
3429 | 947 last_sound_dir = g_dirname(sound_file_new[snd]); |
1170 | 948 } |
949 | |
3366 | 950 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
|
951 { |
1170 | 952 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
953 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
954 if (!sounddialog) { |
1170 | 955 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
956 | |
957 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
958 | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
959 g_snprintf(buf, BUF_LEN - 1, "%s/", last_sound_dir ? last_sound_dir : g_get_home_dir()); |
1170 | 960 |
961 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
962 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
963 gtk_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
964 GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
1170 | 965 |
966 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
3366 | 967 "clicked", GTK_SIGNAL_FUNC(do_select_sound), (int *)sound_row_sel); |
1170 | 968 |
969 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
|
970 "clicked", GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
1170 | 971 } |
972 | |
973 g_free(buf); | |
974 gtk_widget_show(sounddialog); | |
975 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
976 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
977 |
3366 | 978 |
979 #if GTK_CHECK_VERSION (1,3,0) | |
980 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
981 GtkTreeIter iter; | |
982 GValue val = { 0, }; | |
983 | |
984 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
985 return; | |
986 gtk_tree_model_get_value (model, &iter, 2, &val); | |
987 sound_row_sel = g_value_get_uint(&val); | |
988 if (sound_entry) | |
3374 | 989 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[sound_row_sel] ? sound_file_new[sound_row_sel] : "(default)"); |
3366 | 990 g_value_unset (&val); |
991 if (sounddialog) | |
992 gtk_widget_destroy(sounddialog); | |
993 } | |
994 #endif | |
995 | |
996 GtkWidget *sound_events_page() { | |
997 | |
998 GtkWidget *ret; | |
999 GtkWidget *sw; | |
1000 GtkWidget *button, *hbox; | |
1001 GtkTreeIter iter; | |
1002 GtkWidget *event_view; | |
1003 GtkListStore *event_store; | |
1004 GtkCellRenderer *rend; | |
1005 GtkTreeViewColumn *col; | |
1006 GtkTreeSelection *sel; | |
1007 GtkTreePath *path; | |
1008 int j; | |
1009 | |
3427 | 1010 ret = gtk_vbox_new(FALSE, 18); |
1011 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 1012 |
1013 sw = gtk_scrolled_window_new(NULL,NULL); | |
1014 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3427 | 1015 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1016 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
1017 | |
1018 for (j=0; j < NUM_SOUNDS; j++) { | |
1019 if (sounds[j].opt == 0) | |
1020 continue; | |
1021 | |
1022 gtk_list_store_append (event_store, &iter); | |
1023 gtk_list_store_set(event_store, &iter, | |
1024 0, sound_options & sounds[j].opt, | |
1025 1, sounds[j].label, | |
1026 2, j, -1); | |
1027 } | |
1028 | |
1029 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
1030 | |
1031 rend = gtk_cell_renderer_toggle_new(); | |
1032 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1033 g_signal_connect (G_OBJECT (sel), "changed", | |
1034 G_CALLBACK (prefs_sound_sel), | |
1035 NULL); | |
1036 g_signal_connect (G_OBJECT(rend), "toggled", | |
1037 G_CALLBACK(event_toggled), event_store); | |
1038 path = gtk_tree_path_new_first(); | |
1039 gtk_tree_selection_select_path(sel, path); | |
1040 | |
1041 col = gtk_tree_view_column_new_with_attributes ("Play", | |
1042 rend, | |
1043 "active", 0, | |
1044 NULL); | |
1045 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1046 | |
1047 rend = gtk_cell_renderer_text_new(); | |
1048 col = gtk_tree_view_column_new_with_attributes ("Event", | |
1049 rend, | |
1050 "text", 1, | |
1051 NULL); | |
1052 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1053 g_object_unref(G_OBJECT(event_store)); | |
1054 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1055 | |
3427 | 1056 hbox = gtk_hbox_new(FALSE, 6); |
1057 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1058 sound_entry = gtk_entry_new(); |
1059 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[0] ? sound_file_new[0] : "(default)"); | |
1060 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); | |
1061 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
|
1062 |
3025 | 1063 button = gtk_button_new_with_label(_("Test")); |
3366 | 1064 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(test_sound), NULL); |
1065 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
|
1066 |
1175 | 1067 button = gtk_button_new_with_label(_("Reset")); |
3366 | 1068 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(reset_sound), NULL); |
1069 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1175 | 1070 |
1381 | 1071 button = gtk_button_new_with_label(_("Choose...")); |
3366 | 1072 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(sel_sound), NULL); |
1073 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1074 | |
3427 | 1075 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1076 |
3366 | 1077 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1078 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1079 |
3366 | 1080 #if GTK_CHECK_VERSION (1,3,0) |
1081 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1082 { |
3366 | 1083 GtkTreeIter iter; |
1084 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1085 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1086 char *tmp; |
3374 | 1087 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1088 |
3366 | 1089 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1090 return; | |
1091 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1092 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1093 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1094 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1095 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1096 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
|
1097 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1098 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
|
1099 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1100 g_free(tmp); |
3366 | 1101 g_value_unset (&val); |
1102 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1103 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1104 |
3366 | 1105 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
1106 struct away_message *am; | |
1107 GtkTreeIter iter; | |
1108 GtkTreePath *path; | |
1109 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
1110 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1111 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1112 GValue val = { 0, }; |
1113 | |
3379 | 1114 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1115 return; |
3379 | 1116 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1117 am = g_value_get_pointer (&val); |
1118 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1119 rem_away_mess(NULL, am); | |
3379 | 1120 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter); |
1121 path = gtk_tree_path_new_first(); | |
3366 | 1122 gtk_tree_selection_select_path(sel, path); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1123 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1124 |
3366 | 1125 #else |
3374 | 1126 static struct away_message *cur_message; |
1127 void away_message_sel(GtkWidget *w, struct away_message *a) { | |
1128 gchar buffer[BUF_LONG]; | |
1129 char *tmp; | |
1130 | |
1131 cur_message = a; | |
1132 | |
1133 /* Clear the Box */ | |
1134 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1135 | |
1136 /* Fill the text box with new message */ | |
1137 strncpy(buffer, a->message, BUF_LONG); | |
1138 tmp = stylize(buffer, BUF_LONG); | |
1139 | |
1140 debug_printf("FSD: %s\n", tmp); | |
1141 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | | |
1142 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
1143 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | | |
1144 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
1145 g_free(tmp); | |
1146 } | |
1147 void remove_away_message(GtkWidget *widget, GtkWidget *list) { | |
1148 GList *i; | |
1149 struct away_message *a; | |
1150 | |
1151 i = GTK_LIST(prefs_away_list)->selection; | |
1152 | |
1153 if (!i) | |
1154 return; | |
1155 if (!i->next) { | |
1156 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1157 } | |
1158 a = gtk_object_get_user_data(GTK_OBJECT(i->data)); | |
1159 rem_away_mess(NULL, a); | |
1160 } | |
3366 | 1161 #endif |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1162 |
3366 | 1163 GtkWidget *away_message_page() { |
1164 GtkWidget *ret; | |
3427 | 1165 GtkWidget *hbox; |
3379 | 1166 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1167 GtkWidget *sw; |
3366 | 1168 GtkTreeIter iter; |
1169 GtkWidget *event_view; | |
1170 GtkCellRenderer *rend; | |
1171 GtkTreeViewColumn *col; | |
1172 GtkTreeSelection *sel; | |
1173 GtkTreePath *path; | |
940 | 1174 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1175 struct away_message *a; |
3366 | 1176 GtkWidget *sw2; |
3427 | 1177 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1178 |
3427 | 1179 ret = gtk_vbox_new(FALSE, 18); |
1180 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1181 | |
1182 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
1183 | |
3366 | 1184 sw = gtk_scrolled_window_new(NULL,NULL); |
1185 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1186 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3379 | 1187 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), |
1188 GTK_SHADOW_IN); | |
3427 | 1189 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1190 |
3374 | 1191 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1192 while (awy) { |
1193 a = (struct away_message *)awy->data; | |
1194 gtk_list_store_append (prefs_away_store, &iter); | |
1195 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1196 0, a->name, |
1197 1, a, -1); | |
3366 | 1198 awy = awy->next; |
1199 } | |
1200 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
|
1201 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1202 |
3366 | 1203 rend = gtk_cell_renderer_text_new(); |
1204 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1205 rend, | |
1206 "text", 0, | |
1207 NULL); | |
1208 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1209 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1210 gtk_widget_show(event_view); | |
3427 | 1211 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1212 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1213 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1214 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1215 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1216 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3366 | 1217 |
3427 | 1218 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
|
1219 GTK_LAYOUT(away_text)->hadjustment->step_increment = 10.0; |
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1220 GTK_LAYOUT(away_text)->vadjustment->step_increment = 10.0; |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1221 gaim_setup_imhtml(away_text); |
3366 | 1222 gtk_imhtml_set_defaults(GTK_IMHTML(away_text), NULL, NULL, NULL); |
1223 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1224 path = gtk_tree_path_new_first(); | |
1225 g_signal_connect (G_OBJECT (sel), "changed", | |
1226 G_CALLBACK (away_message_sel), | |
1227 NULL); | |
1228 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1229 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1230 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1231 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1232 gtk_size_group_add_widget(sg, button); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1233 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); |
3427 | 1234 |
3366 | 1235 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1236 gtk_size_group_add_widget(sg, button); |
3366 | 1237 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), event_view); |
3427 | 1238 |
3366 | 1239 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1240 button = pixbuf_button(_("_Edit"), "edit.png"); | |
3427 | 1241 gtk_size_group_add_widget(sg, button); |
3374 | 1242 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), event_view); |
3366 | 1243 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1244 | |
3427 | 1245 gtk_widget_show_all(ret); |
3366 | 1246 return ret; |
1247 } | |
1248 #if GTK_CHECK_VERSION (1,3,0) | |
1249 GtkTreeIter *prefs_notebook_add_page(char *text, | |
1250 GdkPixbuf *pixbuf, | |
1251 GtkWidget *page, | |
1252 GtkTreeIter *iter, | |
1253 GtkTreeIter *parent, | |
1254 int ind) { | |
1255 GdkPixbuf *icon = NULL; | |
1256 | |
1257 if (pixbuf) | |
1258 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
|
1259 |
3366 | 1260 gtk_tree_store_append (prefstree, iter, parent); |
1261 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
1262 | |
1263 if (pixbuf) | |
1264 g_object_unref(pixbuf); | |
1265 if (icon) | |
1266 g_object_unref(icon); | |
1267 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1268 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1269 } |
3366 | 1270 #else |
1271 GtkCTreeNode *prefs_notebook_add_page(char *text, | |
1272 GdkPixmap *pixmap, | |
1273 GtkWidget *page, | |
1274 GtkCTreeNode **iter, | |
1275 GtkCTreeNode **parent, | |
1276 int ind) { | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1277 |
3366 | 1278 GtkCTreeNode *itern; |
1279 char *texts[1]; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1280 |
3366 | 1281 texts[0] = text; |
2074
a4367a6478eb
[gaim-migrate @ 2084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
1282 |
3366 | 1283 *iter = gtk_ctree_insert_node (GTK_CTREE(prefstree), parent ? *parent : NULL, NULL, &text, |
1284 0, NULL, NULL, NULL, NULL, 0, 1); | |
1285 gtk_ctree_node_set_row_data(GTK_CTREE(prefstree), GTK_CTREE_NODE(*iter), (void *)ind); | |
1286 if (pixmap) | |
1287 gdk_pixmap_unref(pixmap); | |
1288 | |
1289 debug_printf("%s\n", texts[0]); | |
2074
a4367a6478eb
[gaim-migrate @ 2084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
1290 |
3366 | 1291 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
1292 return iter; | |
2074
a4367a6478eb
[gaim-migrate @ 2084]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
1293 } |
3366 | 1294 #endif |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1295 |
3366 | 1296 void prefs_notebook_init() { |
1297 int a = 0; | |
1298 #if GTK_CHECK_VERSION(1,3,0) | |
1299 GtkTreeIter p, c; | |
1300 #else | |
1301 GtkCTreeNode *p = NULL; | |
1302 GtkCTreeNode *c = NULL; | |
1303 #endif | |
3373 | 1304 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, a++); |
1305 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, a++); | |
1306 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, a++); | |
1307 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, a++); | |
1308 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, a++); | |
1309 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, a++); | |
1310 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, a++); | |
1311 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, a++); | |
1312 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, a++); | |
1313 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
|
1314 |
3373 | 1315 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, a++); |
1316 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, a++); | |
1317 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, a++); | |
1318 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, a++); | |
1319 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
|
1320 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1321 |
3366 | 1322 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1323 { |
3366 | 1324 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1325 GtkWidget *hbox; |
3366 | 1326 GtkWidget *frame; |
1327 #if GTK_CHECK_VERSION (1,3,0) | |
1328 GtkWidget *tree_v; | |
1329 GtkTreeViewColumn *column; | |
1330 GtkCellRenderer *cell; | |
1331 GtkTreeSelection *sel; | |
1332 #endif | |
1333 GtkWidget *notebook; | |
1334 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1335 GtkWidget *button; |
3366 | 1336 |
1337 int r; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1338 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1339 if (prefs) { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1340 gtk_widget_show(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1341 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1342 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1343 |
3366 | 1344 /* copy the preferences to tmp values... |
1345 * I liked "take affect immediately" Oh well :-( */ | |
1346 misc_options_new = misc_options; | |
1347 logging_options_new = logging_options; | |
1348 blist_options_new = blist_options; | |
1349 convo_options_new = convo_options; | |
1350 im_options_new = im_options; | |
1351 chat_options_new = chat_options; | |
1352 font_options_new = font_options; | |
1353 sound_options_new = sound_options; | |
1354 for (r = 0; r < NUM_SOUNDS; r++) | |
1355 sound_file_new[r] = g_strdup(sound_file[r]); | |
1356 away_options_new = away_options; | |
1357 away_resend_new = away_resend; | |
1358 report_idle_new = report_idle; | |
1359 auto_away_new = auto_away; | |
1360 default_away_new = default_away; | |
1361 fontsize_new = fontsize; | |
1362 web_browser_new = web_browser; | |
1363 proxytype_new = proxytype; | |
1364 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", sound_cmd); | |
3432 | 1365 g_snprintf(web_command_new, sizeof(web_command_new), "%s", |
3434 | 1366 web_command ? web_command : "xterm -e lynx %%s"); |
3366 | 1367 g_snprintf(fontface_new, sizeof(fontface_new), fontface); |
1368 #if !GTK_CHECK_VERSION(1,3,0) | |
1369 g_snprintf(fontxfld_new, sizeof(fontxfld_new), fontxfld); | |
1370 #endif | |
1371 memcpy(&conv_size_new, &conv_size, sizeof(struct window_size)); | |
1372 memcpy(&buddy_chat_size_new, &buddy_chat_size, sizeof(struct window_size)); | |
1373 memcpy(&fgcolor_new, &fgcolor, sizeof(GdkColor)); | |
1374 memcpy(&bgcolor_new, &bgcolor, sizeof(GdkColor)); | |
1375 | |
1376 /* Create the window */ | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1377 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
905 | 1378 gtk_window_set_wmclass(GTK_WINDOW(prefs), "preferences", "Gaim"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1379 gtk_widget_realize(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1380 aol_icon(prefs->window); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1381 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
3366 | 1382 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1383 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
|
1384 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1385 vbox = gtk_vbox_new(FALSE, 5); |
1185 | 1386 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1387 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1388 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1389 |
3366 | 1390 hbox = gtk_hbox_new (FALSE, 6); |
1391 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1392 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1393 gtk_widget_show (hbox); | |
1394 | |
1395 frame = gtk_frame_new (NULL); | |
1396 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1397 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1398 gtk_widget_show (frame); | |
1399 | |
1400 /* The tree -- much inspired by the Gimp */ | |
1401 #if GTK_CHECK_VERSION(1,3,0) | |
1402 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1403 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1404 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1405 | |
1406 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1407 gtk_widget_show(tree_v); | |
1408 /* icons */ | |
1409 cell = gtk_cell_renderer_pixbuf_new (); | |
1410 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
1411 | |
1412 /* text */ | |
1413 cell = gtk_cell_renderer_text_new (); | |
1414 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
1415 | |
1416 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
|
1417 |
3366 | 1418 #else |
1419 prefstree = gtk_ctree_new(1,0); | |
1420 gtk_ctree_set_line_style(prefstree, GTK_CTREE_LINES_NONE); | |
1421 gtk_ctree_set_expander_style(GTK_CTREE(prefstree), GTK_CTREE_EXPANDER_TRIANGLE); | |
1422 gtk_container_add(GTK_CONTAINER (frame), prefstree); | |
1423 gtk_widget_set_usize(prefstree, 150, -1); | |
1424 gtk_widget_show(prefstree); | |
1425 #endif /* GTK_CHECK_VERSION */ | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1426 |
3366 | 1427 /* The right side */ |
1428 frame = gtk_frame_new (NULL); | |
1429 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1430 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1431 gtk_widget_show (frame); | |
1432 | |
1433 vbox2 = gtk_vbox_new (FALSE, 4); | |
1434 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1435 gtk_widget_show (vbox2); | |
1436 | |
1437 frame = gtk_frame_new (NULL); | |
1438 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1439 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1440 gtk_widget_show (frame); | |
1441 | |
1442 hbox = gtk_hbox_new (FALSE, 4); | |
1443 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1444 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1445 gtk_widget_show (hbox); | |
1446 | |
1447 preflabel = gtk_label_new(NULL); | |
1448 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1449 gtk_widget_show (preflabel); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1450 |
3366 | 1451 |
1452 /* The notebook */ | |
1453 prefsnotebook = notebook = gtk_notebook_new (); | |
1454 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1455 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1456 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
|
1457 |
3366 | 1458 #if GTK_CHECK_VERSION(1,3,0) |
1459 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); | |
1460 g_signal_connect (G_OBJECT (sel), "changed", | |
1461 G_CALLBACK (pref_nb_select), | |
1462 notebook); | |
1463 #else | |
1464 gtk_signal_connect(GTK_OBJECT(prefstree), "tree-select-row", GTK_SIGNAL_FUNC(pref_nb_select), notebook); | |
1465 #endif | |
1466 gtk_widget_show(notebook); | |
1467 sep = gtk_hseparator_new(); | |
1468 gtk_widget_show(sep); | |
1469 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
1470 | |
1471 /* The buttons to press! */ | |
1472 hbox = gtk_hbox_new (FALSE, 6); | |
1473 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1474 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1475 gtk_widget_show (hbox); | |
3377 | 1476 |
1477 button = gtk_button_new_from_stock (GTK_STOCK_OK); | |
1478 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_cb), prefs); | |
3366 | 1479 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1480 gtk_widget_show(button); | |
3377 | 1481 |
3366 | 1482 button = gtk_button_new_from_stock (GTK_STOCK_APPLY); |
1483 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(apply_cb), prefs); | |
1484 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1485 gtk_widget_show(button); | |
1486 | |
3377 | 1487 button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); |
1488 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), prefs); | |
3366 | 1489 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1490 gtk_widget_show(button); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1491 |
3366 | 1492 prefs_notebook_init(); |
3427 | 1493 |
3366 | 1494 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1495 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1496 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1497 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1498 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1499 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1500 if (debugbutton) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1501 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1502 if (misc_options & OPT_MISC_DEBUG) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1503 misc_options ^= OPT_MISC_DEBUG; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1504 save_prefs(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1505 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1506 g_free(dw); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1507 dw = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1508 return FALSE; |
1 | 1509 |
1510 } | |
1511 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1512 static void build_debug() |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1513 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1514 GtkWidget *scroll; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1515 GtkWidget *box; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1516 if (!dw) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1517 dw = g_new0(struct debug_window, 1); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1518 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1519 GAIM_DIALOG(dw->window); |
2536
0e0a54e5819a
[gaim-migrate @ 2549]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2471
diff
changeset
|
1520 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
|
1521 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
|
1522 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
|
1523 gtk_widget_realize(dw->window); |
ab55ac6234b8
[gaim-migrate @ 2560]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2536
diff
changeset
|
1524 aol_icon(dw->window->window); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1525 |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1526 box = gtk_hbox_new(FALSE, 0); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1527 gtk_container_add(GTK_CONTAINER(dw->window), box); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1528 gtk_widget_show(box); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1529 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1530 dw->entry = gtk_text_new(NULL, NULL); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1531 gtk_text_set_word_wrap(GTK_TEXT(dw->entry), TRUE); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1532 gtk_text_set_editable(GTK_TEXT(dw->entry), FALSE); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1533 gtk_container_add(GTK_CONTAINER(box), dw->entry); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1534 gtk_widget_set_usize(dw->entry, 500, 200); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1535 gtk_widget_show(dw->entry); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1536 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1537 scroll = gtk_vscrollbar_new(GTK_TEXT(dw->entry)->vadj); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1538 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
|
1539 gtk_widget_show(scroll); |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1540 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1541 gtk_widget_show(dw->window); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1542 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1543 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1544 void show_debug() |
1 | 1545 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1546 if ((misc_options & OPT_MISC_DEBUG)) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1547 if (!dw || !dw->window) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1548 build_debug(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1549 gtk_widget_show(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1550 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1551 if (!dw) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1552 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1553 gtk_widget_destroy(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1554 dw->window = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1555 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1556 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1557 |
970 | 1558 void debug_printf(char *fmt, ...) |
1559 { | |
1560 va_list ap; | |
1561 gchar *s; | |
1562 | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1563 va_start(ap, fmt); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1564 s = g_strdup_vprintf(fmt, ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1565 va_end(ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1566 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1567 if (misc_options & OPT_MISC_DEBUG && dw) { |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1568 GtkAdjustment *adj = GTK_TEXT(dw->entry)->vadj; |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1569 gboolean scroll = (adj->value == adj->upper - adj->lower - adj->page_size); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1570 |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1571 gtk_text_freeze(GTK_TEXT(dw->entry)); |
970 | 1572 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
|
1573 gtk_text_thaw(GTK_TEXT(dw->entry)); |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1574 |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1575 if (scroll) |
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1576 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
|
1577 } |
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1578 if (opt_debug) |
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1579 g_print("%s", s); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1580 g_free(s); |
970 | 1581 } |
3366 | 1582 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1583 |
3366 | 1584 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1585 |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
1586 |
3366 | 1587 |
1 | 1588 void set_option(GtkWidget *w, int *option) |
1589 { | |
1590 *option = !(*option); | |
1591 } | |
1592 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1593 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1594 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1595 misc_options ^= option; |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1596 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1597 if (option == OPT_MISC_DEBUG) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1598 show_debug(); |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1599 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1600 save_prefs(); |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1601 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1602 |
3366 | 1603 |
1604 /* Functions for each _options variable that sees what's changed, and makes | |
1605 * effective those changes that take place immediately (UI stuff) */ | |
1606 static void set_misc_options() | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1607 { |
3366 | 1608 |
1609 /* int option = misc_options ^ misc_options_new; */ | |
1610 misc_options = misc_options_new; | |
1611 | |
1612 } | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1613 |
3366 | 1614 static void set_logging_options() |
1615 { | |
1616 int option = logging_options ^ logging_options_new; | |
1617 logging_options = logging_options_new; | |
1618 | |
3457 | 1619 if (option & OPT_LOG_CONVOS || option & OPT_LOG_CHATS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1620 update_log_convs(); |
1773 | 1621 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1622 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1623 |
3366 | 1624 static void set_blist_options() |
1 | 1625 { |
3366 | 1626 int option = blist_options ^ blist_options_new; |
1627 blist_options = blist_options_new; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1628 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1629 if (!blist) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1630 return; |
3366 | 1631 |
1632 if (option & OPT_BLIST_BOTTOM_TAB) | |
1633 set_blist_tab(); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1634 |
3366 | 1635 if (option & OPT_BLIST_NO_BUTTONS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1636 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1637 |
3366 | 1638 if (option & OPT_BLIST_SHOW_GRPNUM) |
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1639 update_num_groups(); |
9 | 1640 |
3366 | 1641 if (option & OPT_BLIST_NO_MT_GRP) |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1642 toggle_show_empty_groups(); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1643 |
3366 | 1644 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
|
1645 update_button_pix(); |
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1646 |
3366 | 1647 if (option & OPT_BLIST_SHOW_PIXMAPS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1648 toggle_buddy_pixmaps(); |
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1649 |
3366 | 1650 if ((option & OPT_BLIST_GREY_IDLERS) || (option & OPT_BLIST_SHOW_IDLETIME)) |
2594 | 1651 update_idle_times(); |
3032 | 1652 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1653 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1654 |
3366 | 1655 static void set_convo_options() |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1656 { |
3366 | 1657 int option = convo_options ^ convo_options_new; |
1658 convo_options = convo_options_new; | |
1659 | |
1660 if (option & OPT_CONVO_SHOW_SMILEY) | |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1661 toggle_smileys(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1662 |
3366 | 1663 if (option & OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1664 toggle_timestamps(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1665 |
3366 | 1666 if (option & OPT_CONVO_CHECK_SPELLING) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1667 toggle_spellchk(); |
572
faca21605e1b
[gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
1668 |
3366 | 1669 if (option & OPT_CONVO_COMBINE) { |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1670 /* (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB) == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB) */ |
3366 | 1671 |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1672 } |
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1673 |
1 | 1674 } |
1675 | |
3366 | 1676 static void set_im_options() |
1 | 1677 { |
3366 | 1678 int option = im_options ^ im_options_new; |
1679 im_options = im_options_new; | |
1680 | |
1681 if (option & OPT_IM_ONE_WINDOW) | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1682 im_tabize(); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1683 |
3366 | 1684 if (option & OPT_IM_SIDE_TAB || option & OPT_IM_BR_TAB) |
1685 update_im_tabs(); | |
1686 | |
1687 if (option & OPT_IM_HIDE_ICONS) | |
2323
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2322
diff
changeset
|
1688 set_hide_icons(); |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2322
diff
changeset
|
1689 |
3366 | 1690 if (option & OPT_IM_ALIAS_TAB) |
2787
feea7103a235
[gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2760
diff
changeset
|
1691 set_convo_titles(); |
feea7103a235
[gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2760
diff
changeset
|
1692 |
3366 | 1693 if (option & OPT_IM_NO_ANIMATION) |
3013 | 1694 set_anim(); |
3366 | 1695 |
1696 if (option & OPT_IM_BUTTON_TEXT || option & OPT_IM_BUTTON_XPM) | |
1697 update_im_button_pix(); | |
1 | 1698 } |
1699 | |
3366 | 1700 static void set_chat_options() |
1 | 1701 { |
3366 | 1702 int option = chat_options ^ chat_options_new; |
1703 chat_options = chat_options_new; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1704 |
3366 | 1705 if (option & OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1706 chat_tabize(); |
3366 | 1707 |
1708 if (option & OPT_CHAT_BUTTON_TEXT || option & OPT_CHAT_BUTTON_XPM) | |
1709 update_chat_button_pix(); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1710 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1711 |
3366 | 1712 void set_sound_options() |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1713 { |
3366 | 1714 /* int option = sound_options ^ sound_options_new; */ |
1715 sound_options = sound_options_new; | |
1716 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1717 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1718 |
3366 | 1719 static void set_font_options() |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1720 { |
3366 | 1721 /* int option = font_options ^ font_options_new; */ |
1722 font_options = font_options_new; | |
1723 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1724 update_font_buttons(); |
1 | 1725 } |
1726 | |
3366 | 1727 static void set_away_options() |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1728 { |
3366 | 1729 int option = away_options ^ away_options_new; |
1730 away_options = away_options_new; | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1731 |
3366 | 1732 if (option & OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1733 toggle_away_queue(); |
3366 | 1734 } |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1735 |
3366 | 1736 static void toggle_option(GtkWidget *w, int option) { |
1737 int *o = gtk_object_get_user_data(GTK_OBJECT(w)); | |
1738 *o ^= option; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1739 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1740 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1741 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 1742 { |
1743 GtkWidget *button; | |
3427 | 1744 button = gtk_check_button_new_with_mnemonic(text); |
1 | 1745 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
1746 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
3366 | 1747 gtk_object_set_user_data(GTK_OBJECT(button), options); |
1 | 1748 |
3391 | 1749 /* So that the debug window happens immediately |
1750 * I don't think it should be "preferences," anyway. */ | |
1751 if (options == &misc_options && option == OPT_MISC_DEBUG) | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1752 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
|
1753 (int *)option); |
3366 | 1754 else |
1755 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
|
1756 (int *)option); |
3366 | 1757 |
1 | 1758 gtk_widget_show(button); |
1759 | |
1760 return button; | |
1761 } | |
1762 | |
3366 | 1763 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
1764 {} | |
1765 void default_away_menu_init(GtkWidget *omenu) | |
3032 | 1766 { |
3366 | 1767 GtkWidget *menu, *opt; |
1768 int index = 0; | |
1769 GSList *awy = away_messages; | |
1770 struct away_message *a; | |
1771 | |
1772 menu = gtk_menu_new(); | |
1773 | |
1774 while (awy) { | |
1775 a = (struct away_message *)awy->data; | |
1776 opt = gtk_menu_item_new_with_label(a->name); | |
1777 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_default_away), | |
1778 (gpointer)index); | |
1779 gtk_widget_show(opt); | |
1780 gtk_menu_append(GTK_MENU(menu), opt); | |
1781 | |
1782 awy = awy->next; | |
1783 index++; | |
1784 } | |
1785 | |
1786 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
1787 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
1788 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
1789 } | |
1790 | |
1791 GtkWidget *pref_fg_picture = NULL; | |
1792 GtkWidget *pref_bg_picture = NULL; | |
1793 | |
1794 void destroy_colorsel(GtkWidget *w, gpointer d) | |
1795 { | |
1796 if (d) { | |
1797 gtk_widget_destroy(fgcseld); | |
1798 fgcseld = NULL; | |
1799 } else { | |
1800 gtk_widget_destroy(bgcseld); | |
1801 bgcseld = NULL; | |
1802 } | |
3032 | 1803 } |
1804 | |
3366 | 1805 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 1806 { |
3379 | 1807 #if GTK_CHECK_VERSION(1,3,0) |
3366 | 1808 if ((int)d == 1) { |
1809 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
1810 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), | |
1811 &fgcolor_new); | |
1812 #else | |
3379 | 1813 gdouble color[3]; |
1814 if ((int)d == 1) { | |
3366 | 1815 gtk_color_selection_get_color(GTK_COLOR_SELECTION |
1816 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), color); | |
3032 | 1817 |
3366 | 1818 fgcolor_new.red = ((guint16)(color[0] * 65535)) >> 8; |
1819 fgcolor_new.green = ((guint16)(color[1] * 65535)) >> 8; | |
1820 fgcolor_new.blue = ((guint16)(color[2] * 65535)) >> 8; | |
1821 #endif | |
1822 destroy_colorsel(NULL, (void *)1); | |
1823 update_color(NULL, pref_fg_picture); | |
1824 } else { | |
1825 #if GTK_CHECK_VERSION(1,3,0) | |
1826 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
1827 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), | |
1828 &bgcolor_new); | |
1829 #else | |
1830 gtk_color_selection_get_color(GTK_COLOR_SELECTION | |
1831 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), color); | |
1832 | |
1833 bgcolor_new.red = ((guint16)(color[0] * 65535)) >> 8; | |
1834 bgcolor_new.green = ((guint16)(color[1] * 65535)) >> 8; | |
1835 bgcolor_new.blue = ((guint16)(color[2] * 65535)) >> 8; | |
1836 #endif | |
1837 destroy_colorsel(NULL, (void *)0); | |
1838 update_color(NULL, pref_bg_picture); | |
1839 } | |
3032 | 1840 } |
1841 | |
3366 | 1842 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 1843 { |
3366 | 1844 GdkColor c; |
1845 GtkStyle *style; | |
1846 c.pixel = 0; | |
1847 | |
1848 if (pic == pref_fg_picture) { | |
1849 if (font_options_new & OPT_FONT_FGCOL) { | |
1850 c.red = fgcolor_new.red; | |
1851 c.blue = fgcolor_new.blue; | |
1852 c.green = fgcolor_new.green; | |
1853 } else { | |
1854 c.red = 0; | |
1855 c.blue = 0; | |
1856 c.green = 0; | |
1857 } | |
1858 } else { | |
1859 if (font_options_new & OPT_FONT_BGCOL) { | |
1860 c.red = bgcolor_new.red; | |
1861 c.blue = bgcolor_new.blue; | |
1862 c.green = bgcolor_new.green; | |
1863 } else { | |
1864 c.red = 0xffff; | |
1865 c.blue = 0xffff; | |
1866 c.green = 0xffff; | |
1867 } | |
1868 } | |
1869 | |
1870 style = gtk_style_new(); | |
1871 style->bg[0] = c; | |
1872 gtk_widget_set_style(pic, style); | |
1873 gtk_style_unref(style); | |
1874 } | |
1875 void set_default_away(GtkWidget *w, gpointer i) | |
1876 { | |
1877 | |
1878 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1879 |
3366 | 1880 if (away_messages == NULL) |
1881 default_away_new = NULL; | |
1882 else if ((int)i >= length) | |
1883 default_away_new = g_slist_nth_data(away_messages, length - 1); | |
1884 else | |
1885 default_away_new = g_slist_nth_data(away_messages, (int)i); | |
1886 } | |
1887 | |
1888 static void update_spin_value(GtkWidget *w, GtkWidget *spin) | |
1889 { | |
1890 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
1891 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
1892 } | |
3427 | 1893 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 1894 { |
1895 GtkWidget *hbox; | |
1896 GtkWidget *label; | |
1897 GtkWidget *spin; | |
1898 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
1899 |
3366 | 1900 hbox = gtk_hbox_new(FALSE, 5); |
1901 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
1902 gtk_widget_show(hbox); | |
1903 | |
3427 | 1904 label = gtk_label_new_with_mnemonic(title); |
3366 | 1905 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1906 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
1907 |
3366 | 1908 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
1909 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
1910 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
1911 gtk_widget_set_usize(spin, 50, -1); | |
1912 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
1913 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed", | |
1914 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin)); | |
1915 gtk_widget_show(spin); | |
3427 | 1916 |
1917 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); | |
1918 | |
1919 if (sg) { | |
1920 gtk_size_group_add_widget(sg, label); | |
1921 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1922 | |
1923 } | |
1924 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1925 } |
1 | 1926 |
3366 | 1927 void dropdown_set(GtkObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1928 { |
3366 | 1929 int opt = (int)gtk_object_get_user_data(w); |
1930 int clear = (int)gtk_object_get_data(w, "clear"); | |
1931 | |
1932 if (clear != -1) { | |
1933 *option = *option & ~clear; | |
1934 *option = *option | opt; | |
1935 } else { | |
1936 debug_printf("HELLO %d\n", opt); | |
1937 *option = opt; | |
1938 } | |
1939 | |
1940 if (option == &proxytype_new) { | |
1941 if (opt == PROXY_NONE) | |
1942 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
1943 else | |
1944 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
1945 } else if (option == &web_browser_new) { | |
1946 if (opt == BROWSER_MANUAL) | |
1947 gtk_widget_set_sensitive(browser_entry, TRUE); | |
1948 else | |
1949 gtk_widget_set_sensitive(browser_entry, FALSE); | |
3379 | 1950 } else if (*option == sound_options_new) { |
3366 | 1951 if (opt == OPT_SOUND_CMD) |
1952 gtk_widget_set_sensitive(sndcmd, TRUE); | |
1953 else | |
1954 gtk_widget_set_sensitive(sndcmd, FALSE); | |
1955 } | |
1956 | |
1 | 1957 } |
1958 | |
3366 | 1959 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 1960 { |
3366 | 1961 va_list menuitems; |
1962 GtkWidget *dropdown, *opt, *menu; | |
1963 GtkWidget *label; | |
1964 gchar *text; | |
1965 int value; | |
1966 int o = 0; | |
1967 GtkWidget *hbox; | |
1 | 1968 |
3366 | 1969 hbox = gtk_hbox_new(FALSE, 5); |
1970 gtk_container_add (GTK_CONTAINER (box), hbox); | |
1971 gtk_widget_show(hbox); | |
1972 | |
3427 | 1973 label = gtk_label_new_with_mnemonic(title); |
3366 | 1974 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1975 gtk_widget_show(label); | |
1976 | |
1977 va_start(menuitems, clear); | |
1978 text = va_arg(menuitems, gchar *); | |
1979 | |
1980 if (!text) | |
1981 return NULL; | |
1982 | |
1983 dropdown = gtk_option_menu_new(); | |
1984 menu = gtk_menu_new(); | |
3427 | 1985 |
1986 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); | |
1987 | |
3366 | 1988 while (text) { |
1989 value = va_arg(menuitems, int); | |
1990 opt = gtk_menu_item_new_with_label(text); | |
1991 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
1992 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
1993 gtk_signal_connect(GTK_OBJECT(opt), "activate", | |
1994 GTK_SIGNAL_FUNC(dropdown_set), (void *)option); | |
1995 gtk_widget_show(opt); | |
1996 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 1997 |
3366 | 1998 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
1999 gtk_menu_set_active(GTK_MENU(menu), o); | |
2000 } | |
2001 text = va_arg(menuitems, gchar *); | |
2002 o++; | |
2003 } | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2004 |
3366 | 2005 va_end(menuitems); |
1 | 2006 |
3366 | 2007 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
2008 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); | |
2009 gtk_widget_show(dropdown); | |
3427 | 2010 return label; |
3366 | 2011 } |
2012 | |
2013 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) | |
1 | 2014 { |
3366 | 2015 /* more stuff stolen from X-Chat */ |
2016 GtkWidget *swid; | |
2017 GdkColor c; | |
2018 GtkStyle *style; | |
2019 c.pixel = 0; | |
2020 if (fgc) { | |
2021 if (font_options_new & OPT_FONT_FGCOL) { | |
2022 c.red = fgcolor_new.red; | |
2023 c.blue = fgcolor_new.blue; | |
2024 c.green = fgcolor_new.green; | |
2025 } else { | |
2026 c.red = 0; | |
2027 c.blue = 0; | |
2028 c.green = 0; | |
2029 } | |
2030 } else { | |
2031 if (font_options_new & OPT_FONT_BGCOL) { | |
2032 c.red = bgcolor_new.red; | |
2033 c.blue = bgcolor_new.blue; | |
2034 c.green = bgcolor_new.green; | |
2035 } else { | |
2036 c.red = 0xffff; | |
2037 c.blue = 0xffff; | |
2038 c.green = 0xffff; | |
2039 } | |
2040 } | |
1 | 2041 |
3366 | 2042 style = gtk_style_new(); |
2043 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2044 |
3366 | 2045 swid = gtk_event_box_new(); |
2046 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
2047 gtk_style_unref(style); | |
2048 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); | |
2049 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2050 gtk_widget_show(swid); | |
2051 return swid; | |
1 | 2052 } |
3366 | 2053 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2054 { |
3366 | 2055 int i = 0; |
2056 #if !GTK_CHECK_VERSION(1,3,0) | |
2057 int j = 0, k = 0; | |
2058 #endif | |
2059 char *fontname; | |
2060 | |
2061 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontseld))); | |
2062 destroy_fontsel(0, 0); | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2063 |
3366 | 2064 #if !GTK_CHECK_VERSION(1,3,0) |
2065 for (i = 0; i < strlen(fontname); i++) { | |
2066 if (fontname[i] == '-') { | |
2067 if (++j > 2) | |
2068 break; | |
2069 } else if (j == 2) | |
2070 fontface_new[k++] = fontname[i]; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2071 } |
3366 | 2072 fontface_new[k] = '\0'; |
2073 g_snprintf(fontxfld_new, sizeof(fontxfld_new), "%s", fontname); | |
2074 #else | |
2075 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface_new)) { | |
2076 fontface_new[i] = fontname[i]; | |
2077 i++; | |
2078 } | |
2079 | |
2080 #endif | |
2081 g_free(fontname); | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2082 } |