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