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