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