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