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