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