Mercurial > pidgin.yaz
annotate src/prefs.c @ 4089:7f4f3aa61069
[gaim-migrate @ 4304]
Changing the button style in Preferences no longer reverts conversation
windows to the old style. It should work now. Pictures, Text, and Pictures
& Text all work for IMs and chats here. However, there may be bugs, so let
me know.
Note that the style you select is not applied to newly created windows
during the same session or when gaim is restarted. This isn't my fault! :)
This probably broke during either the preferences or conversations rewrite.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 17 Dec 2002 04:44:00 +0000 |
parents | 4b04ecb3eb97 |
children | 260ebd4bdc8d |
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, |
4082 | 677 #endif |
678 #ifdef ARTSC_SOUND | |
3366 | 679 "ArtsC", OPT_SOUND_ARTSC, |
4082 | 680 #endif |
681 #ifdef NAS_SOUND | |
3366 | 682 "NAS", OPT_SOUND_NAS, |
4082 | 683 #endif |
3366 | 684 "Internal", OPT_SOUND_NORMAL, |
685 "Command", OPT_SOUND_CMD, NULL); | |
3427 | 686 gtk_size_group_add_widget(sg, dd); |
687 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
688 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
689 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
690 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 691 |
3366 | 692 hbox = gtk_hbox_new(FALSE, 5); |
693 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 694 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 695 gtk_size_group_add_widget(sg, label); |
696 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 697 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
|
698 |
3366 | 699 sndcmd = gtk_entry_new(); |
3427 | 700 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
701 |
3366 | 702 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
703 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
704 gtk_widget_set_size_request(sndcmd, 75, -1); | |
3427 | 705 |
3818 | 706 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
3366 | 707 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
708 gtk_signal_connect(GTK_OBJECT(sndcmd), "focus_out_event", GTK_SIGNAL_FUNC(sound_cmd_yeah), NULL); | |
3630 | 709 #endif /* _WIN32 */ |
3427 | 710 gtk_widget_show_all(ret); |
3366 | 711 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
712 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
713 |
3366 | 714 GtkWidget *away_page() { |
715 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
716 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
717 GtkWidget *hbox; |
3366 | 718 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
719 GtkWidget *button; |
3366 | 720 GtkWidget *select; |
3427 | 721 GtkWidget *dd; |
722 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
723 |
3427 | 724 ret = gtk_vbox_new(FALSE, 18); |
725 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
726 |
3427 | 727 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
728 |
3427 | 729 vbox = make_frame (ret, _("Away")); |
3818 | 730 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
731 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
732 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
|
733 |
3427 | 734 vbox = make_frame (ret, _("Auto-response")); |
3366 | 735 hbox = gtk_hbox_new(FALSE, 0); |
736 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 737 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
3818 | 738 &away_resend, 1, 24 * 60 * 60, sg); |
739 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
740 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
741 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
|
742 |
3818 | 743 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
3366 | 744 gtk_widget_set_sensitive(hbox, FALSE); |
3500 | 745 |
3427 | 746 vbox = make_frame (ret, _("Idle")); |
4052 | 747 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
748 _("None"), IDLE_NONE, | |
749 _("Gaim usage"), IDLE_GAIM, | |
3366 | 750 #ifdef USE_SCREENSAVER |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
751 #ifndef _WIN32 |
4052 | 752 _("X usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
753 #else |
4052 | 754 _("Windows usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
755 #endif |
3366 | 756 #endif |
3427 | 757 NULL); |
758 gtk_size_group_add_widget(sg, dd); | |
759 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
760 |
3427 | 761 vbox = make_frame (ret, _("Auto-away")); |
3818 | 762 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
4052 | 763 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
3818 | 764 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 765 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
766 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
1 | 767 |
4052 | 768 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
3427 | 769 gtk_size_group_add_widget(sg, label); |
770 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 771 hbox = gtk_hbox_new(FALSE, 0); |
772 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
773 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
774 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 775 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3818 | 776 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 777 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
778 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), prefs_away_menu); | |
779 default_away_menu_init(prefs_away_menu); | |
780 gtk_widget_show(prefs_away_menu); | |
781 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
3500 | 782 |
3427 | 783 gtk_widget_show_all(ret); |
3366 | 784 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
785 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
786 |
3551 | 787 #if USE_PLUGINS |
788 GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
789 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
790 { | |
791 gchar buf[1024]; | |
792 GtkTreeIter iter; | |
793 GValue val = { 0, }; | |
794 struct gaim_plugin *plug; | |
795 | |
796 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
797 return; | |
798 gtk_tree_model_get_value (model, &iter, 2, &val); | |
799 plug = g_value_get_pointer(&val); | |
800 | |
3563 | 801 if (plug->error[0]) |
802 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
803 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
804 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description); | |
805 else | |
806 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
807 "%s"), plug->desc.name, plug->desc.version, plug->desc.description); | |
3551 | 808 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3630 | 809 g_snprintf(buf, sizeof(buf), |
810 #ifndef _WIN32 | |
811 _("<span size=\"larger\">%s %s</span>\n\n" | |
812 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
813 "<span weight=\"bold\">URL:</span>\t%s\n" | |
814 "<span weight=\"bold\">File name:</span>\t%s"), | |
815 #else | |
816 _("<span size=\"larger\">%s %s</span>\n\n" | |
817 "<span weight=\"bold\">Written by:</span> %s\n" | |
818 "<span weight=\"bold\">URL:</span> %s\n" | |
819 "<span weight=\"bold\">File name:</span> %s"), | |
820 #endif | |
3551 | 821 plug->desc.name, plug->desc.version, plug->desc.authors, plug->desc.url, plug->path); |
822 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
823 g_value_unset (&val); | |
824 } | |
825 | |
826 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
827 { | |
828 GtkTreeModel *model = (GtkTreeModel *)data; | |
829 GtkTreeIter iter; | |
830 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
831 struct gaim_plugin *plug; | |
832 gchar buf[1024]; | |
3565 | 833 GtkWidget *(*config)(); |
834 | |
3551 | 835 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
836 gdk_window_set_cursor(prefs->window, wait); | |
837 gdk_cursor_unref(wait); | |
838 | |
839 gtk_tree_model_get_iter (model, &iter, path); | |
840 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
841 | |
842 if (!plug->handle) | |
843 | |
844 if (plug->type == plugin) | |
845 #ifdef GAIM_PLUGINS | |
3565 | 846 { |
847 load_plugin(plug->path); | |
848 if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
849 plug->iter = g_new0(GtkTreeIter, 1); | |
850 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
3567 | 851 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), &plugin_iter) == 1) { |
852 /* Expand the tree for the first plugin added */ | |
3630 | 853 GtkTreePath *path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), &plugin_iter); |
3567 | 854 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), path2, TRUE); |
855 gtk_tree_path_free (path2); | |
856 } | |
3565 | 857 } |
858 } | |
3551 | 859 #else |
860 {} | |
861 #endif | |
862 else | |
863 #ifdef USE_PERL | |
864 perl_load_file(plug->path); | |
865 #else | |
866 {} | |
867 #endif | |
868 else | |
869 if (plug->type == plugin) | |
870 #ifdef GAIM_PLUGINS | |
3565 | 871 { |
872 unload_plugin(plug); | |
873 if (plug->iter) { | |
874 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter); | |
875 g_free(plug->iter); | |
876 plug->iter = NULL; | |
877 } | |
878 } | |
3551 | 879 #else |
880 {} | |
881 #endif | |
882 else | |
883 #ifdef USE_PERL | |
884 perl_unload_file(plug); | |
885 #else | |
886 {} | |
887 #endif | |
888 gdk_window_set_cursor(prefs->window, NULL); | |
3563 | 889 if (plug->error[0]) |
890 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
891 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
892 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description); | |
893 else | |
894 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n" | |
895 "%s"), plug->desc.name, plug->desc.version, plug->desc.description); | |
896 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
3551 | 897 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, plug->handle, -1); |
3563 | 898 |
3551 | 899 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
900 gtk_tree_path_free(path); | |
901 } | |
902 | |
903 static GtkWidget *plugin_page () | |
904 { | |
905 GtkWidget *ret; | |
906 | |
907 GtkWidget *sw, *vp; | |
908 GtkTreeIter iter; | |
909 GtkWidget *event_view; | |
910 GtkListStore *ls; | |
911 GtkCellRenderer *rend, *rendt; | |
912 GtkTreeViewColumn *col; | |
913 GtkTreeSelection *sel; | |
914 GtkTreePath *path; | |
915 | |
916 GtkWidget *nb; | |
917 | |
918 GList *probes = probed_plugins; | |
919 struct gaim_plugin *plug; | |
920 | |
921 ret = gtk_vbox_new(FALSE, 18); | |
922 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
923 | |
924 sw = gtk_scrolled_window_new(NULL,NULL); | |
925 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
926 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
927 | |
928 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
929 | |
930 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
931 while (probes) { | |
932 plug = probes->data; | |
933 gtk_list_store_append (ls, &iter); | |
934 gtk_list_store_set(ls, &iter, | |
935 0, plug->handle, | |
936 1, plug->desc.name ? plug->desc.name : plug->path, | |
937 2, plug, -1); | |
938 probes = probes->next; | |
939 } | |
940 | |
941 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
942 | |
943 rend = gtk_cell_renderer_toggle_new(); | |
944 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
945 | |
946 | |
947 col = gtk_tree_view_column_new_with_attributes ("Load", | |
948 rend, | |
949 "active", 0, | |
950 NULL); | |
951 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
952 | |
953 rendt = gtk_cell_renderer_text_new(); | |
954 col = gtk_tree_view_column_new_with_attributes ("Name", | |
955 rendt, | |
956 "text", 1, | |
957 NULL); | |
958 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
959 g_object_unref(G_OBJECT(ls)); | |
960 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
961 | |
962 | |
963 nb = gtk_notebook_new(); | |
964 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
965 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
966 | |
967 /* Description */ | |
968 sw = gtk_scrolled_window_new(NULL, NULL); | |
969 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
970 plugin_description = gtk_label_new(NULL); | |
971 | |
972 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 973 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 974 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
975 | |
3630 | 976 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
977 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 978 |
3630 | 979 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
980 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
3551 | 981 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
982 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
983 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
984 | |
985 /* Details */ | |
986 sw = gtk_scrolled_window_new(NULL, NULL); | |
987 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
988 plugin_details = gtk_label_new(NULL); | |
989 | |
990 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 991 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 992 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
993 | |
3630 | 994 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
995 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 996 |
3630 | 997 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
998 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
3551 | 999 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
1000 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1001 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1002 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1003 | |
1004 g_signal_connect (G_OBJECT (sel), "changed", | |
1005 G_CALLBACK (prefs_plugin_sel), | |
1006 NULL); | |
1007 g_signal_connect (G_OBJECT(rend), "toggled", | |
1008 G_CALLBACK(plugin_load), ls); | |
1009 | |
1010 path = gtk_tree_path_new_first(); | |
1011 gtk_tree_selection_select_path(sel, path); | |
1012 gtk_tree_path_free(path); | |
1013 | |
1014 gtk_widget_show_all(ret); | |
1015 return ret; | |
1016 } | |
1017 #endif | |
1018 | |
3366 | 1019 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1020 { |
3366 | 1021 GtkTreeModel *model = (GtkTreeModel *)data; |
1022 GtkTreeIter iter; | |
1023 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
3500 | 1024 gint soundnum; |
3366 | 1025 |
1026 gtk_tree_model_get_iter (model, &iter, path); | |
1027 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1028 |
3818 | 1029 sound_options ^= sounds[soundnum].opt; |
1030 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & sounds[soundnum].opt, -1); | |
3522 | 1031 |
1032 gtk_tree_path_free(path); | |
3366 | 1033 } |
1034 | |
1035 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1036 { | |
1037 guint32 tmp_sound = sound_options; | |
1038 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
1039 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
1040 if (!(sound_options & sounds[sound_row_sel].opt)) | |
1041 sound_options ^= sounds[sound_row_sel].opt; | |
1042 play_sound(sound_row_sel); | |
3500 | 1043 |
3366 | 1044 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1045 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1046 |
3366 | 1047 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
|
1048 { |
3366 | 1049 /* This just resets a sound file back to default */ |
3818 | 1050 if (sound_file[sound_row_sel]) { |
1051 g_free(sound_file[sound_row_sel]); | |
1052 sound_file[sound_row_sel] = NULL; | |
3485 | 1053 } |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1054 |
3366 | 1055 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1056 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1057 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1058 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 1059 { |
1060 | |
1061 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1062 |
1170 | 1063 if (!GTK_IS_WIDGET(w2)) |
1064 dest = w; | |
1065 else | |
1066 dest = w2; | |
1067 | |
1068 sounddialog = NULL; | |
1069 | |
1070 gtk_widget_destroy(dest); | |
1071 } | |
1072 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1073 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1074 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1075 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1076 |
1170 | 1077 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
1078 | |
1079 /* If they type in a directory, change there */ | |
1080 if (file_is_dir(file, sounddialog)) | |
1081 return; | |
1082 | |
1083 /* Let's just be safe */ | |
3818 | 1084 if (sound_file[snd]) |
1085 g_free(sound_file[snd]); | |
1170 | 1086 |
1087 /* Set it -- and forget it */ | |
3818 | 1088 sound_file[snd] = g_strdup(file); |
3500 | 1089 |
1175 | 1090 /* Set our text entry */ |
3818 | 1091 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
|
1092 |
1170 | 1093 /* Close the window! It's getting cold in here! */ |
1094 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1095 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1096 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1097 g_free(last_sound_dir); |
3818 | 1098 last_sound_dir = g_dirname(sound_file[snd]); |
1170 | 1099 } |
1100 | |
3366 | 1101 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
|
1102 { |
1170 | 1103 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1104 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1105 if (!sounddialog) { |
1170 | 1106 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
1107 | |
1108 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1109 | |
3630 | 1110 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
1170 | 1111 |
1112 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1113 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1114 gtk_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1115 GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
1170 | 1116 |
1117 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
3366 | 1118 "clicked", GTK_SIGNAL_FUNC(do_select_sound), (int *)sound_row_sel); |
1170 | 1119 |
1120 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
|
1121 "clicked", GTK_SIGNAL_FUNC(close_sounddialog), sounddialog); |
1170 | 1122 } |
1123 | |
1124 g_free(buf); | |
1125 gtk_widget_show(sounddialog); | |
1126 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1127 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1128 |
3366 | 1129 |
1130 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1131 GtkTreeIter iter; | |
1132 GValue val = { 0, }; | |
3500 | 1133 |
3366 | 1134 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1135 return; | |
1136 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1137 sound_row_sel = g_value_get_uint(&val); | |
1138 if (sound_entry) | |
3818 | 1139 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[sound_row_sel] ? sound_file[sound_row_sel] : "(default)"); |
3366 | 1140 g_value_unset (&val); |
1141 if (sounddialog) | |
1142 gtk_widget_destroy(sounddialog); | |
1143 } | |
1144 | |
1145 GtkWidget *sound_events_page() { | |
1146 | |
1147 GtkWidget *ret; | |
1148 GtkWidget *sw; | |
1149 GtkWidget *button, *hbox; | |
1150 GtkTreeIter iter; | |
1151 GtkWidget *event_view; | |
1152 GtkListStore *event_store; | |
1153 GtkCellRenderer *rend; | |
1154 GtkTreeViewColumn *col; | |
1155 GtkTreeSelection *sel; | |
1156 GtkTreePath *path; | |
1157 int j; | |
1158 | |
3427 | 1159 ret = gtk_vbox_new(FALSE, 18); |
1160 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 1161 |
1162 sw = gtk_scrolled_window_new(NULL,NULL); | |
1163 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3814 | 1164 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1165 | |
3427 | 1166 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1167 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
1168 | |
1169 for (j=0; j < NUM_SOUNDS; j++) { | |
1170 if (sounds[j].opt == 0) | |
1171 continue; | |
3500 | 1172 |
3366 | 1173 gtk_list_store_append (event_store, &iter); |
1174 gtk_list_store_set(event_store, &iter, | |
1175 0, sound_options & sounds[j].opt, | |
3500 | 1176 1, sounds[j].label, |
3366 | 1177 2, j, -1); |
1178 } | |
1179 | |
1180 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
3500 | 1181 |
3366 | 1182 rend = gtk_cell_renderer_toggle_new(); |
1183 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1184 g_signal_connect (G_OBJECT (sel), "changed", | |
1185 G_CALLBACK (prefs_sound_sel), | |
1186 NULL); | |
1187 g_signal_connect (G_OBJECT(rend), "toggled", | |
1188 G_CALLBACK(event_toggled), event_store); | |
1189 path = gtk_tree_path_new_first(); | |
1190 gtk_tree_selection_select_path(sel, path); | |
3522 | 1191 gtk_tree_path_free(path); |
3500 | 1192 |
3366 | 1193 col = gtk_tree_view_column_new_with_attributes ("Play", |
1194 rend, | |
1195 "active", 0, | |
1196 NULL); | |
1197 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1198 | |
1199 rend = gtk_cell_renderer_text_new(); | |
1200 col = gtk_tree_view_column_new_with_attributes ("Event", | |
1201 rend, | |
1202 "text", 1, | |
1203 NULL); | |
1204 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
3500 | 1205 g_object_unref(G_OBJECT(event_store)); |
3366 | 1206 gtk_container_add(GTK_CONTAINER(sw), event_view); |
1207 | |
3427 | 1208 hbox = gtk_hbox_new(FALSE, 6); |
1209 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1210 sound_entry = gtk_entry_new(); |
3818 | 1211 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file[0] ? sound_file[0] : "(default)"); |
3366 | 1212 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); |
1213 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
|
1214 |
3025 | 1215 button = gtk_button_new_with_label(_("Test")); |
3366 | 1216 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(test_sound), NULL); |
1217 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
|
1218 |
1175 | 1219 button = gtk_button_new_with_label(_("Reset")); |
3366 | 1220 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(reset_sound), NULL); |
1221 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1175 | 1222 |
1381 | 1223 button = gtk_button_new_with_label(_("Choose...")); |
3366 | 1224 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(sel_sound), NULL); |
1225 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
3500 | 1226 |
3427 | 1227 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1228 |
3366 | 1229 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1230 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1231 |
3366 | 1232 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1233 { |
3366 | 1234 GtkTreeIter iter; |
1235 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1236 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1237 char *tmp; |
3374 | 1238 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1239 |
3366 | 1240 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1241 return; | |
1242 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1243 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1244 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1245 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1246 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1247 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
|
1248 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1249 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
|
1250 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1251 g_free(tmp); |
3366 | 1252 g_value_unset (&val); |
3500 | 1253 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1254 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1255 |
3500 | 1256 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
3366 | 1257 struct away_message *am; |
1258 GtkTreeIter iter; | |
1259 GtkTreePath *path; | |
1260 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
1261 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1262 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1263 GValue val = { 0, }; |
3500 | 1264 |
3379 | 1265 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1266 return; |
3379 | 1267 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1268 am = g_value_get_pointer (&val); |
1269 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1270 rem_away_mess(NULL, am); | |
3379 | 1271 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter); |
1272 path = gtk_tree_path_new_first(); | |
3366 | 1273 gtk_tree_selection_select_path(sel, path); |
3522 | 1274 gtk_tree_path_free(path); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1275 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1276 |
3366 | 1277 GtkWidget *away_message_page() { |
1278 GtkWidget *ret; | |
3427 | 1279 GtkWidget *hbox; |
3379 | 1280 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1281 GtkWidget *sw; |
3366 | 1282 GtkTreeIter iter; |
1283 GtkWidget *event_view; | |
1284 GtkCellRenderer *rend; | |
1285 GtkTreeViewColumn *col; | |
1286 GtkTreeSelection *sel; | |
940 | 1287 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1288 struct away_message *a; |
3366 | 1289 GtkWidget *sw2; |
3427 | 1290 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1291 |
3427 | 1292 ret = gtk_vbox_new(FALSE, 18); |
1293 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1294 | |
1295 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
3500 | 1296 |
3366 | 1297 sw = gtk_scrolled_window_new(NULL,NULL); |
1298 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1299 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3817 | 1300 /* |
1301 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1302 */ | |
3427 | 1303 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3500 | 1304 |
3374 | 1305 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1306 while (awy) { |
1307 a = (struct away_message *)awy->data; | |
1308 gtk_list_store_append (prefs_away_store, &iter); | |
1309 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1310 0, a->name, |
1311 1, a, -1); | |
3366 | 1312 awy = awy->next; |
1313 } | |
1314 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
|
1315 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1316 |
3366 | 1317 rend = gtk_cell_renderer_text_new(); |
1318 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1319 rend, | |
1320 "text", 0, | |
1321 NULL); | |
1322 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1323 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1324 gtk_widget_show(event_view); | |
3427 | 1325 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1326 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1327 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1328 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1329 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1330 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3500 | 1331 |
3427 | 1332 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
|
1333 gaim_setup_imhtml(away_text); |
3366 | 1334 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
1335 g_signal_connect (G_OBJECT (sel), "changed", | |
1336 G_CALLBACK (away_message_sel), | |
1337 NULL); | |
1338 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1339 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1340 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1341 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1342 gtk_size_group_add_widget(sg, button); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1343 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); |
3472 | 1344 |
3366 | 1345 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1346 gtk_size_group_add_widget(sg, button); |
3366 | 1347 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), event_view); |
3472 | 1348 |
3366 | 1349 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1350 |
3649 | 1351 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL); |
3427 | 1352 gtk_size_group_add_widget(sg, button); |
3374 | 1353 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), event_view); |
3366 | 1354 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1355 |
3427 | 1356 gtk_widget_show_all(ret); |
3366 | 1357 return ret; |
1358 } | |
3472 | 1359 |
3500 | 1360 GtkTreeIter *prefs_notebook_add_page(char *text, |
1361 GdkPixbuf *pixbuf, | |
1362 GtkWidget *page, | |
3366 | 1363 GtkTreeIter *iter, |
3500 | 1364 GtkTreeIter *parent, |
3366 | 1365 int ind) { |
1366 GdkPixbuf *icon = NULL; | |
3500 | 1367 |
3366 | 1368 if (pixbuf) |
3500 | 1369 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
|
1370 |
3366 | 1371 gtk_tree_store_append (prefstree, iter, parent); |
1372 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1373 |
3366 | 1374 if (pixbuf) |
1375 g_object_unref(pixbuf); | |
1376 if (icon) | |
1377 g_object_unref(icon); | |
1378 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1379 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1380 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1381 |
3366 | 1382 void prefs_notebook_init() { |
1383 GtkTreeIter p, c; | |
3565 | 1384 #if USE_PLUGINS |
1385 GtkWidget *(*config)(); | |
1386 GList *l = plugins; | |
1387 struct gaim_plugin *plug; | |
1388 #endif | |
1389 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
1390 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | |
1391 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1392 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1393 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
1394 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); | |
1395 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, notebook_page++); | |
1396 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, notebook_page++); | |
1397 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | |
1398 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
|
1399 |
3565 | 1400 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
1401 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1402 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1403 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1404 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
3551 | 1405 #if USE_PLUGINS |
3565 | 1406 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
1407 while (l) { | |
1408 plug = l->data; | |
1409 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
1410 plug->iter = g_new0(GtkTreeIter, 1); | |
1411 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
1412 } | |
1413 l = l->next; | |
1414 } | |
3551 | 1415 #endif |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1416 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1417 |
3500 | 1418 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1419 { |
3366 | 1420 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1421 GtkWidget *hbox; |
3366 | 1422 GtkWidget *frame; |
1423 GtkTreeViewColumn *column; | |
1424 GtkCellRenderer *cell; | |
1425 GtkTreeSelection *sel; | |
1426 GtkWidget *notebook; | |
1427 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1428 GtkWidget *button; |
3515 | 1429 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
3500 | 1430 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1431 if (prefs) { |
3472 | 1432 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1433 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1434 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1435 |
3366 | 1436 /* copy the preferences to tmp values... |
1437 * I liked "take affect immediately" Oh well :-( */ | |
3818 | 1438 |
1439 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
3500 | 1440 |
3366 | 1441 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1442 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4074 | 1443 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1444 gtk_widget_realize(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1445 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
3366 | 1446 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1447 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
|
1448 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1449 vbox = gtk_vbox_new(FALSE, 5); |
1185 | 1450 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1451 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1452 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1453 |
3366 | 1454 hbox = gtk_hbox_new (FALSE, 6); |
1455 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1456 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1457 gtk_widget_show (hbox); | |
1458 | |
1459 frame = gtk_frame_new (NULL); | |
1460 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1461 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1462 gtk_widget_show (frame); | |
3500 | 1463 |
3366 | 1464 /* The tree -- much inspired by the Gimp */ |
1465 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1466 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1467 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1468 | |
1469 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1470 gtk_widget_show(tree_v); | |
1471 /* icons */ | |
1472 cell = gtk_cell_renderer_pixbuf_new (); | |
1473 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
3500 | 1474 |
3366 | 1475 /* text */ |
1476 cell = gtk_cell_renderer_text_new (); | |
1477 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1478 |
3366 | 1479 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
|
1480 |
3472 | 1481 /* The right side */ |
1482 frame = gtk_frame_new (NULL); | |
1483 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1484 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1485 gtk_widget_show (frame); | |
3500 | 1486 |
3472 | 1487 vbox2 = gtk_vbox_new (FALSE, 4); |
1488 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1489 gtk_widget_show (vbox2); | |
3500 | 1490 |
3472 | 1491 frame = gtk_frame_new (NULL); |
1492 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1493 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1494 gtk_widget_show (frame); | |
3500 | 1495 |
3472 | 1496 hbox = gtk_hbox_new (FALSE, 4); |
1497 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1498 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1499 gtk_widget_show (hbox); | |
3500 | 1500 |
3472 | 1501 preflabel = gtk_label_new(NULL); |
1502 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1503 gtk_widget_show (preflabel); | |
3500 | 1504 |
3472 | 1505 /* The notebook */ |
1506 prefsnotebook = notebook = gtk_notebook_new (); | |
1507 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1508 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1509 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
|
1510 |
3472 | 1511 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1512 g_signal_connect (G_OBJECT (sel), "changed", | |
1513 G_CALLBACK (pref_nb_select), | |
1514 notebook); | |
3500 | 1515 gtk_widget_show(notebook); |
3472 | 1516 sep = gtk_hseparator_new(); |
1517 gtk_widget_show(sep); | |
1518 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1519 |
3818 | 1520 /* The buttons^H to press! */ |
3472 | 1521 hbox = gtk_hbox_new (FALSE, 6); |
1522 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1523 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1524 gtk_widget_show (hbox); |
3377 | 1525 |
3818 | 1526 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
3515 | 1527 gtk_size_group_add_widget(sg, button); |
1528 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), prefs); | |
1529 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1530 gtk_widget_show(button); | |
1531 | |
3500 | 1532 prefs_notebook_init(); |
3427 | 1533 |
3472 | 1534 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1535 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1536 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1537 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1538 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1539 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1540 if (debugbutton) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1541 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1542 if (misc_options & OPT_MISC_DEBUG) { |
3818 | 1543 misc_options ^= OPT_MISC_DEBUG; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1544 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1545 g_free(dw); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1546 dw = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1547 return FALSE; |
1 | 1548 |
1549 } | |
1550 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1551 static void build_debug() |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1552 { |
4005 | 1553 GtkWidget *sw; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1554 GtkWidget *box; |
4005 | 1555 GtkTextBuffer *buffer; |
1556 GtkTextIter end; | |
1557 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1558 if (!dw) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1559 dw = g_new0(struct debug_window, 1); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1560 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1561 GAIM_DIALOG(dw->window); |
4005 | 1562 gtk_window_set_default_size(GTK_WINDOW(dw->window), 500, 200); |
1563 gtk_window_set_role(GTK_WINDOW(dw->window), "debug"); | |
1564 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim - Debug Window")); | |
1565 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
|
1566 |
4005 | 1567 sw = gtk_scrolled_window_new(NULL, NULL); |
1568 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
1569 GTK_POLICY_NEVER, | |
1570 GTK_POLICY_ALWAYS); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1571 |
4005 | 1572 dw->entry = gtk_text_view_new(); |
1573 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1574 gtk_text_view_set_editable(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1575 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
|
1576 |
4005 | 1577 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1578 gtk_text_buffer_get_end_iter(buffer, &end); | |
1579 gtk_text_buffer_create_mark(buffer, "end", &end, FALSE); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1580 |
4005 | 1581 gtk_container_add(GTK_CONTAINER(sw), dw->entry); |
1582 gtk_container_add(GTK_CONTAINER(dw->window), sw); | |
1583 gtk_widget_show_all(dw->window); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1584 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1585 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1586 void show_debug() |
1 | 1587 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1588 if ((misc_options & OPT_MISC_DEBUG)) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1589 if (!dw || !dw->window) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1590 build_debug(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1591 gtk_widget_show(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1592 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1593 if (!dw) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1594 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1595 gtk_widget_destroy(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1596 dw->window = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1597 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1598 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1599 |
970 | 1600 void debug_printf(char *fmt, ...) |
1601 { | |
1602 va_list ap; | |
1603 gchar *s; | |
1604 | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1605 va_start(ap, fmt); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1606 s = g_strdup_vprintf(fmt, ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1607 va_end(ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1608 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1609 if (misc_options & OPT_MISC_DEBUG && dw) { |
4005 | 1610 GtkTextBuffer *buffer; |
1611 GtkTextMark *endmark; | |
1612 GtkTextIter end; | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1613 |
4005 | 1614 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1615 endmark = gtk_text_buffer_get_mark(buffer, "end"); | |
1616 gtk_text_buffer_get_iter_at_mark(buffer, &end, endmark); | |
1617 gtk_text_buffer_insert(buffer, &end, s, -1); | |
1618 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
|
1619 } |
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1620 if (opt_debug) |
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1621 g_print("%s", s); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1622 g_free(s); |
970 | 1623 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1624 |
1 | 1625 void set_option(GtkWidget *w, int *option) |
1626 { | |
1627 *option = !(*option); | |
1628 } | |
1629 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1630 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1631 { |
3818 | 1632 misc_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1633 |
3818 | 1634 if (option == OPT_MISC_DEBUG) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1635 show_debug(); |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1636 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1637 |
3818 | 1638 static void set_logging_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1639 { |
3818 | 1640 logging_options ^= option; |
3500 | 1641 |
3818 | 1642 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
1643 update_log_convs(); | |
3366 | 1644 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1645 |
3818 | 1646 static void set_blist_option(GtkWidget *w, int option) |
3366 | 1647 { |
3818 | 1648 blist_options ^= option; |
3500 | 1649 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1650 if (!blist) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1651 return; |
3500 | 1652 |
3818 | 1653 if (option == OPT_BLIST_NO_BUTTONS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1654 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1655 |
3818 | 1656 if (option == OPT_BLIST_SHOW_GRPNUM) |
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1657 update_num_groups(); |
9 | 1658 |
3818 | 1659 if (option == OPT_BLIST_NO_MT_GRP) |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1660 toggle_show_empty_groups(); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1661 |
3818 | 1662 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
|
1663 update_button_pix(); |
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1664 |
3818 | 1665 if (option == OPT_BLIST_SHOW_PIXMAPS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1666 toggle_buddy_pixmaps(); |
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1667 |
3818 | 1668 if ((option == OPT_BLIST_GREY_IDLERS) || (option == OPT_BLIST_SHOW_IDLETIME)) |
2594 | 1669 update_idle_times(); |
3032 | 1670 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1671 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1672 |
3818 | 1673 static void set_convo_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1674 { |
3818 | 1675 convo_options ^= option; |
3500 | 1676 |
3818 | 1677 if (option == OPT_CONVO_SHOW_SMILEY) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1678 toggle_smileys(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1679 |
3818 | 1680 if (option == OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1681 toggle_timestamps(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1682 |
3818 | 1683 if (option == OPT_CONVO_CHECK_SPELLING) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1684 toggle_spellchk(); |
3818 | 1685 } |
1686 | |
1687 static void set_im_option(GtkWidget *w, int option) | |
1688 { | |
1689 im_options ^= option; | |
3500 | 1690 |
3818 | 1691 if (option == OPT_IM_ONE_WINDOW) |
1692 im_tabize(); | |
1693 | |
1694 if (option == OPT_IM_HIDE_ICONS) | |
1695 set_hide_icons(); | |
1696 | |
1697 if (option == OPT_IM_ALIAS_TAB) { | |
1698 set_convo_titles(); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1699 } |
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1700 |
3818 | 1701 if (option == OPT_IM_NO_ANIMATION) |
3013 | 1702 set_anim(); |
1 | 1703 } |
1704 | |
3818 | 1705 static void set_chat_option(GtkWidget *w, int option) |
1 | 1706 { |
3818 | 1707 chat_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1708 |
3818 | 1709 if (option == OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1710 chat_tabize(); |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1711 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1712 |
3818 | 1713 void set_sound_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1714 { |
3818 | 1715 sound_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1716 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1717 |
3818 | 1718 static void set_font_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1719 { |
3818 | 1720 font_options ^= option; |
3500 | 1721 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1722 update_font_buttons(); |
1 | 1723 } |
1724 | |
3818 | 1725 static void set_away_option(GtkWidget *w, int option) |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1726 { |
3818 | 1727 away_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1728 |
3818 | 1729 if (option == OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1730 toggle_away_queue(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1731 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1732 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1733 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 1734 { |
1735 GtkWidget *button; | |
3427 | 1736 button = gtk_check_button_new_with_mnemonic(text); |
1 | 1737 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
1738 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
3366 | 1739 gtk_object_set_user_data(GTK_OBJECT(button), options); |
1 | 1740 |
4064 | 1741 if (options == &misc_options) { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1742 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
|
1743 (int *)option); |
4064 | 1744 } else if (options == &logging_options) { |
3818 | 1745 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_logging_option), |
1746 (int *)option); | |
4064 | 1747 } else if (options == &blist_options) { |
3818 | 1748 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_blist_option), |
1749 (int *)option); | |
4064 | 1750 } else if (options == &convo_options) { |
3818 | 1751 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_convo_option), |
1752 (int *)option); | |
4064 | 1753 } else if (options == &im_options) { |
3818 | 1754 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_im_option), |
1755 (int *)option); | |
4064 | 1756 } else if (options == &chat_options) { |
3818 | 1757 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_chat_option), |
1758 (int *)option); | |
4064 | 1759 } else if (options == &font_options) { |
3818 | 1760 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_font_option), |
1761 (int *)option); | |
4064 | 1762 } else if (options == &sound_options) { |
3818 | 1763 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option), |
1764 (int *)option); | |
4064 | 1765 } else if (options == &away_options) { |
1766 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_away_option), | |
1767 (int *)option); | |
1768 } else { | |
1769 debug_printf("gaim_button: \"%s\" has no signal handler attached to it!\n", text); | |
1770 } | |
1 | 1771 gtk_widget_show(button); |
1772 | |
1773 return button; | |
1774 } | |
1775 | |
3366 | 1776 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
1777 {} | |
1778 void default_away_menu_init(GtkWidget *omenu) | |
3032 | 1779 { |
3366 | 1780 GtkWidget *menu, *opt; |
1781 int index = 0; | |
1782 GSList *awy = away_messages; | |
1783 struct away_message *a; | |
1784 | |
1785 menu = gtk_menu_new(); | |
1786 | |
1787 while (awy) { | |
1788 a = (struct away_message *)awy->data; | |
1789 opt = gtk_menu_item_new_with_label(a->name); | |
1790 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_default_away), | |
1791 (gpointer)index); | |
1792 gtk_widget_show(opt); | |
1793 gtk_menu_append(GTK_MENU(menu), opt); | |
1794 | |
1795 awy = awy->next; | |
1796 index++; | |
1797 } | |
1798 | |
1799 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
1800 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
1801 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
1802 } | |
1803 | |
1804 GtkWidget *pref_fg_picture = NULL; | |
1805 GtkWidget *pref_bg_picture = NULL; | |
1806 | |
1807 void destroy_colorsel(GtkWidget *w, gpointer d) | |
1808 { | |
1809 if (d) { | |
1810 gtk_widget_destroy(fgcseld); | |
1811 fgcseld = NULL; | |
1812 } else { | |
1813 gtk_widget_destroy(bgcseld); | |
1814 bgcseld = NULL; | |
1815 } | |
3032 | 1816 } |
1817 | |
3366 | 1818 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 1819 { |
3366 | 1820 if ((int)d == 1) { |
1821 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1822 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3818 | 1823 &fgcolor); |
3366 | 1824 destroy_colorsel(NULL, (void *)1); |
1825 update_color(NULL, pref_fg_picture); | |
1826 } else { | |
1827 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1828 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3818 | 1829 &bgcolor); |
3366 | 1830 destroy_colorsel(NULL, (void *)0); |
1831 update_color(NULL, pref_bg_picture); | |
1832 } | |
3032 | 1833 } |
1834 | |
3366 | 1835 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 1836 { |
3366 | 1837 GdkColor c; |
1838 GtkStyle *style; | |
1839 c.pixel = 0; | |
3500 | 1840 |
3366 | 1841 if (pic == pref_fg_picture) { |
3818 | 1842 if (font_options & OPT_FONT_FGCOL) { |
1843 c.red = fgcolor.red; | |
1844 c.blue = fgcolor.blue; | |
1845 c.green = fgcolor.green; | |
3366 | 1846 } else { |
1847 c.red = 0; | |
1848 c.blue = 0; | |
1849 c.green = 0; | |
1850 } | |
1851 } else { | |
3818 | 1852 if (font_options & OPT_FONT_BGCOL) { |
1853 c.red = bgcolor.red; | |
1854 c.blue = bgcolor.blue; | |
1855 c.green = bgcolor.green; | |
3366 | 1856 } else { |
1857 c.red = 0xffff; | |
1858 c.blue = 0xffff; | |
1859 c.green = 0xffff; | |
1860 } | |
1861 } | |
1862 | |
1863 style = gtk_style_new(); | |
1864 style->bg[0] = c; | |
1865 gtk_widget_set_style(pic, style); | |
1866 gtk_style_unref(style); | |
1867 } | |
4064 | 1868 |
3366 | 1869 void set_default_away(GtkWidget *w, gpointer i) |
1870 { | |
1871 | |
1872 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1873 |
3366 | 1874 if (away_messages == NULL) |
3818 | 1875 default_away = NULL; |
3366 | 1876 else if ((int)i >= length) |
3818 | 1877 default_away = g_slist_nth_data(away_messages, length - 1); |
3366 | 1878 else |
3818 | 1879 default_away = g_slist_nth_data(away_messages, (int)i); |
3366 | 1880 } |
3500 | 1881 |
3366 | 1882 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
1883 { | |
1884 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
1885 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
1886 } | |
4064 | 1887 |
3427 | 1888 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 1889 { |
1890 GtkWidget *hbox; | |
1891 GtkWidget *label; | |
1892 GtkWidget *spin; | |
1893 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
1894 |
3366 | 1895 hbox = gtk_hbox_new(FALSE, 5); |
1896 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
1897 gtk_widget_show(hbox); | |
1898 | |
3427 | 1899 label = gtk_label_new_with_mnemonic(title); |
3366 | 1900 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1901 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
1902 |
3366 | 1903 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
1904 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
1905 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
1906 gtk_widget_set_usize(spin, 50, -1); | |
1907 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
1908 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed", | |
4064 | 1909 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin)); |
3366 | 1910 gtk_widget_show(spin); |
3500 | 1911 |
3427 | 1912 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
1913 | |
1914 if (sg) { | |
1915 gtk_size_group_add_widget(sg, label); | |
1916 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 1917 |
3427 | 1918 } |
1919 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1920 } |
1 | 1921 |
3366 | 1922 void dropdown_set(GtkObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1923 { |
3366 | 1924 int opt = (int)gtk_object_get_user_data(w); |
1925 int clear = (int)gtk_object_get_data(w, "clear"); | |
3500 | 1926 |
3366 | 1927 if (clear != -1) { |
1928 *option = *option & ~clear; | |
1929 *option = *option | opt; | |
1930 } else { | |
1931 debug_printf("HELLO %d\n", opt); | |
1932 *option = opt; | |
1933 } | |
3500 | 1934 |
3818 | 1935 if (option == &proxytype) { |
3366 | 1936 if (opt == PROXY_NONE) |
1937 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
1938 else | |
1939 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
3818 | 1940 } else if (option == &web_browser) { |
3366 | 1941 if (opt == BROWSER_MANUAL) |
1942 gtk_widget_set_sensitive(browser_entry, TRUE); | |
1943 else | |
1944 gtk_widget_set_sensitive(browser_entry, FALSE); | |
3818 | 1945 } else if (option == (int*)&sound_options) { |
3366 | 1946 if (opt == OPT_SOUND_CMD) |
1947 gtk_widget_set_sensitive(sndcmd, TRUE); | |
1948 else | |
1949 gtk_widget_set_sensitive(sndcmd, FALSE); | |
3818 | 1950 } else if (option == (int*)&im_options) { |
1951 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
1952 update_im_tabs(); | |
1953 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) | |
1954 update_im_button_pix(); | |
1955 } else if (option == (int*)&chat_options) { | |
1956 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
4089
7f4f3aa61069
[gaim-migrate @ 4304]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
1957 update_chat_tabs(); |
3818 | 1958 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
4089
7f4f3aa61069
[gaim-migrate @ 4304]
Christian Hammond <chipx86@chipx86.com>
parents:
4082
diff
changeset
|
1959 update_chat_button_pix(); |
3818 | 1960 } else if (option == (int*)&blist_options) { |
1961 set_blist_tab(); | |
3366 | 1962 } |
1 | 1963 } |
1964 | |
3500 | 1965 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 1966 { |
3366 | 1967 va_list menuitems; |
1968 GtkWidget *dropdown, *opt, *menu; | |
1969 GtkWidget *label; | |
1970 gchar *text; | |
1971 int value; | |
1972 int o = 0; | |
1973 GtkWidget *hbox; | |
1 | 1974 |
3366 | 1975 hbox = gtk_hbox_new(FALSE, 5); |
1976 gtk_container_add (GTK_CONTAINER (box), hbox); | |
1977 gtk_widget_show(hbox); | |
1978 | |
3427 | 1979 label = gtk_label_new_with_mnemonic(title); |
3366 | 1980 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1981 gtk_widget_show(label); | |
1982 | |
1983 va_start(menuitems, clear); | |
1984 text = va_arg(menuitems, gchar *); | |
1985 | |
1986 if (!text) | |
1987 return NULL; | |
3500 | 1988 |
3366 | 1989 dropdown = gtk_option_menu_new(); |
1990 menu = gtk_menu_new(); | |
3500 | 1991 |
3427 | 1992 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 1993 |
3366 | 1994 while (text) { |
1995 value = va_arg(menuitems, int); | |
1996 opt = gtk_menu_item_new_with_label(text); | |
1997 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
1998 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
1999 gtk_signal_connect(GTK_OBJECT(opt), "activate", | |
2000 GTK_SIGNAL_FUNC(dropdown_set), (void *)option); | |
2001 gtk_widget_show(opt); | |
2002 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 2003 |
3366 | 2004 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
2005 gtk_menu_set_active(GTK_MENU(menu), o); | |
2006 } | |
2007 text = va_arg(menuitems, gchar *); | |
2008 o++; | |
2009 } | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2010 |
3366 | 2011 va_end(menuitems); |
1 | 2012 |
3500 | 2013 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 2014 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
2015 gtk_widget_show(dropdown); | |
3427 | 2016 return label; |
3500 | 2017 } |
2018 | |
3366 | 2019 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 2020 { |
3366 | 2021 /* more stuff stolen from X-Chat */ |
2022 GtkWidget *swid; | |
2023 GdkColor c; | |
2024 GtkStyle *style; | |
2025 c.pixel = 0; | |
2026 if (fgc) { | |
3818 | 2027 if (font_options & OPT_FONT_FGCOL) { |
2028 c.red = fgcolor.red; | |
2029 c.blue = fgcolor.blue; | |
2030 c.green = fgcolor.green; | |
3366 | 2031 } else { |
2032 c.red = 0; | |
2033 c.blue = 0; | |
2034 c.green = 0; | |
2035 } | |
2036 } else { | |
3818 | 2037 if (font_options & OPT_FONT_BGCOL) { |
2038 c.red = bgcolor.red; | |
2039 c.blue = bgcolor.blue; | |
2040 c.green = bgcolor.green; | |
3366 | 2041 } else { |
2042 c.red = 0xffff; | |
2043 c.blue = 0xffff; | |
2044 c.green = 0xffff; | |
2045 } | |
2046 } | |
1 | 2047 |
3366 | 2048 style = gtk_style_new(); |
2049 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2050 |
3366 | 2051 swid = gtk_event_box_new(); |
2052 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
2053 gtk_style_unref(style); | |
2054 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); | |
2055 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2056 gtk_widget_show(swid); | |
2057 return swid; | |
1 | 2058 } |
4064 | 2059 |
3366 | 2060 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2061 { |
3366 | 2062 int i = 0; |
2063 char *fontname; | |
2064 | |
3473 | 2065 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 2066 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2067 |
3818 | 2068 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
2069 fontface[i] = fontname[i]; | |
3366 | 2070 i++; |
2071 } | |
3818 | 2072 fontface[i] = 0; |
3366 | 2073 g_free(fontname); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2074 } |
3500 | 2075 |