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