Mercurial > pidgin
annotate src/prefs.c @ 4009:a9541aded628
[gaim-migrate @ 4209]
robot101 did not test his patch. faceprint fixed it at least some. nas is still broke
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 27 Nov 2002 22:00:23 +0000 |
parents | 7aab0cc1ec78 |
children | 2b18ea0ade13 |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
1 | 5 * |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 | |
28 #include <sys/types.h> | |
29 #include <sys/stat.h> | |
30 | |
31 #include <unistd.h> | |
32 #include <stdio.h> | |
33 #include <stdlib.h> | |
970 | 34 #include <stdarg.h> |
3379 | 35 #include <ctype.h> |
1 | 36 #include <gtk/gtk.h> |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
1 | 38 #include "gaim.h" |
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
39 #include "prpl.h" |
3366 | 40 #include "proxy.h" |
41 | |
42 char fontface[128]; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
43 |
3567 | 44 GtkWidget *tree_v = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
45 GtkWidget *prefs_away_list = NULL; |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
46 GtkWidget *prefs_away_menu = NULL; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
47 GtkWidget *preftree = NULL; |
3366 | 48 GtkWidget *fontseld = NULL; |
49 | |
3379 | 50 GtkListStore *prefs_away_store = NULL; |
3366 | 51 |
52 static int sound_row_sel = 0; | |
53 static char *last_sound_dir = NULL; | |
54 | |
55 static GtkWidget *sounddialog = NULL; | |
56 static GtkWidget *browser_entry = NULL; | |
57 static GtkWidget *sound_entry = NULL; | |
58 static GtkWidget *away_text = NULL; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
59 GtkCTreeNode *general_node = NULL; |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
60 GtkCTreeNode *deny_node = NULL; |
2254 | 61 GtkWidget *prefs_proxy_frame = NULL; |
3366 | 62 static GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
3427 | 63 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
3366 | 64 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
65 static GtkWidget *show_color_pref(GtkWidget *, gboolean); | |
66 static void delete_prefs(GtkWidget *, void *); | |
67 void set_default_away(GtkWidget *, gpointer); | |
1026 | 68 |
3366 | 69 struct debug_window *dw = NULL; |
3565 | 70 GtkWidget *prefs = NULL; |
3366 | 71 GtkWidget *debugbutton = NULL; |
3565 | 72 static int notebook_page = 0; |
73 static GtkTreeIter plugin_iter; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
74 |
3630 | 75 /* |
76 * PROTOTYPES | |
77 */ | |
78 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); | |
79 | |
3366 | 80 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
3485 | 81 prefs = NULL; |
3567 | 82 tree_v = NULL; |
3485 | 83 sound_entry = NULL; |
84 browser_entry = NULL; | |
3526 | 85 debugbutton = NULL; |
86 prefs_away_menu = NULL; | |
3565 | 87 notebook_page = 0; |
3485 | 88 if(sounddialog) |
3379 | 89 gtk_widget_destroy(sounddialog); |
3500 | 90 g_object_unref(G_OBJECT(prefs_away_store)); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
91 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
92 |
3366 | 93 GtkWidget *preflabel; |
94 GtkWidget *prefsnotebook; | |
95 GtkTreeStore *prefstree; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
96 |
3818 | 97 static void set_misc_option(); |
98 static void set_logging_option(); | |
99 static void set_blist_option(); | |
100 static void set_convo_option(); | |
101 static void set_im_option(); | |
102 static void set_chat_option(); | |
103 static void set_font_option(); | |
104 static void set_sound_option(); | |
105 static void set_away_option(); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
106 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
107 #define PROXYHOST 0 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
108 #define PROXYPORT 1 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
109 #define PROXYTYPE 2 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
110 #define PROXYUSER 3 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
111 #define PROXYPASS 4 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
112 static void proxy_print_option(GtkEntry *entry, int entrynum) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
113 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
114 if (entrynum == PROXYHOST) |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
115 g_snprintf(proxyhost, sizeof(proxyhost), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
116 else if (entrynum == PROXYPORT) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
117 proxyport = atoi(gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
118 else if (entrynum == PROXYUSER) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
119 g_snprintf(proxyuser, sizeof(proxyuser), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
120 else if (entrynum == PROXYPASS) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
121 g_snprintf(proxypass, sizeof(proxypass), "%s", gtk_entry_get_text(entry)); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
122 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
123 |
3366 | 124 |
3565 | 125 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
3427 | 126 GtkWidget *vbox, *label, *hbox; |
127 char labeltext[256]; | |
3500 | 128 |
3427 | 129 vbox = gtk_vbox_new(FALSE, 6); |
130 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
131 label = gtk_label_new(NULL); | |
132 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
133 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
134 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
135 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
136 hbox = gtk_hbox_new(FALSE, 6); | |
137 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
138 label = gtk_label_new(" "); | |
139 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
140 vbox = gtk_vbox_new(FALSE, 6); | |
141 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
142 return vbox; | |
143 } | |
144 | |
3366 | 145 /* OK, Apply and Cancel */ |
146 | |
3427 | 147 |
3366 | 148 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { |
149 GtkTreeIter iter; | |
3427 | 150 char text[128]; |
3366 | 151 GValue val = { 0, }; |
152 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
3500 | 153 |
3366 | 154 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
155 return; | |
156 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3500 | 157 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
3427 | 158 g_value_get_string(&val)); |
159 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
3366 | 160 g_value_unset (&val); |
161 gtk_tree_model_get_value (model, &iter, 2, &val); | |
162 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
163 | |
164 } | |
165 | |
166 /* These are the pages in the preferences notebook */ | |
167 GtkWidget *interface_page() { | |
168 GtkWidget *ret; | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
169 GtkWidget *vbox; |
3427 | 170 ret = gtk_vbox_new(FALSE, 18); |
171 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 172 |
3427 | 173 vbox = make_frame(ret, _("Interface Options")); |
174 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */ | |
175 /* This really shouldn't be in preferences at all */ | |
3818 | 176 debugbutton = gaim_button(_("Show _Debug Window"), &misc_options, OPT_MISC_DEBUG, vbox); |
3500 | 177 |
3366 | 178 |
3427 | 179 gtk_widget_show_all(ret); |
3366 | 180 return ret; |
181 } | |
182 | |
183 GtkWidget *font_page() { | |
184 GtkWidget *ret; | |
185 GtkWidget *button; | |
186 GtkWidget *vbox, *hbox; | |
187 GtkWidget *select = NULL; | |
3427 | 188 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 189 |
3427 | 190 ret = gtk_vbox_new(FALSE, 18); |
191 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 192 |
3427 | 193 vbox = make_frame(ret, _("Style")); |
3818 | 194 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
195 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
196 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
197 gaim_button(_("_Strikethough"), &font_options, OPT_FONT_STRIKE, vbox); | |
3500 | 198 |
3427 | 199 vbox = make_frame(ret, _("Face")); |
200 hbox = gtk_hbox_new(FALSE, 6); | |
201 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 202 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
3427 | 203 gtk_size_group_add_widget(sg, button); |
204 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
3366 | 205 |
3818 | 206 if (!(font_options & OPT_FONT_FACE)) |
3366 | 207 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
208 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
3500 | 209 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); |
3366 | 210 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
211 | |
212 hbox = gtk_hbox_new(FALSE, 5); | |
213 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 214 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
3427 | 215 gtk_size_group_add_widget(sg, button); |
3818 | 216 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
217 if (!(font_options & OPT_FONT_SIZE)) | |
3366 | 218 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
219 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
220 | |
3500 | 221 vbox = make_frame(ret, _("Color")); |
3366 | 222 hbox = gtk_hbox_new(FALSE, 5); |
223 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 224 |
225 | |
3818 | 226 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
3427 | 227 gtk_size_group_add_widget(sg, button); |
228 | |
229 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
230 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 231 pref_fg_picture = show_color_pref(hbox, TRUE); |
232 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), | |
233 pref_fg_picture); | |
3427 | 234 |
3818 | 235 if (!(font_options & OPT_FONT_FGCOL)) |
3366 | 236 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
237 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
238 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_fgcolor_dialog), NULL); | |
239 hbox = gtk_hbox_new(FALSE, 5); | |
240 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 241 |
3818 | 242 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
3427 | 243 gtk_size_group_add_widget(sg, button); |
244 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
245 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 246 pref_bg_picture = show_color_pref(hbox, FALSE); |
3427 | 247 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), |
3366 | 248 pref_bg_picture); |
3472 | 249 |
3818 | 250 if (!(font_options & OPT_FONT_BGCOL)) |
3366 | 251 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
252 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_bgcolor_dialog), NULL); | |
253 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select); | |
254 | |
3427 | 255 gtk_widget_show_all(ret); |
3366 | 256 return ret; |
257 } | |
258 | |
259 | |
260 GtkWidget *messages_page() { | |
261 GtkWidget *ret; | |
262 GtkWidget *vbox; | |
3427 | 263 ret = gtk_vbox_new(FALSE, 18); |
264 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 265 |
3427 | 266 vbox = make_frame (ret, _("Display")); |
3818 | 267 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
268 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
269 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
3803 | 270 #ifdef USE_GTKSPELL |
3818 | 271 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
3803 | 272 #endif |
3427 | 273 vbox = make_frame (ret, _("Ignore")); |
3818 | 274 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
275 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
276 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
277 /* gaim_button(_("Ignore Ti_K Automated Messages"), &away_options, OPT_AWAY_TIK_HACK, vbox); */ | |
3500 | 278 |
3427 | 279 gtk_widget_show_all(ret); |
3366 | 280 return ret; |
281 } | |
282 | |
283 GtkWidget *hotkeys_page() { | |
284 GtkWidget *ret; | |
285 GtkWidget *vbox; | |
3427 | 286 ret = gtk_vbox_new(FALSE, 18); |
287 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 288 |
3427 | 289 vbox = make_frame(ret, _("Send Message")); |
3818 | 290 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
291 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
3500 | 292 |
3427 | 293 vbox = make_frame (ret, _("Window Closing")); |
3818 | 294 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
295 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
3366 | 296 |
3427 | 297 vbox = make_frame(ret, "Insertions"); |
3818 | 298 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
299 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
300 |
3427 | 301 gtk_widget_show_all(ret); |
3366 | 302 return ret; |
303 } | |
304 | |
305 GtkWidget *list_page() { | |
306 GtkWidget *ret; | |
307 GtkWidget *vbox; | |
3427 | 308 ret = gtk_vbox_new(FALSE, 18); |
309 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 310 |
3427 | 311 vbox = make_frame (ret, _("Buttons")); |
3818 | 312 gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options, OPT_BLIST_NO_BUTTONS, vbox); |
313 gaim_button(_("Show _pictures on buttons"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM, vbox); | |
3366 | 314 |
3427 | 315 vbox = make_frame (ret, _("Buddy List Window")); |
3818 | 316 gaim_button(_("_Save Window Size/Position"), &blist_options, OPT_BLIST_SAVED_WINDOWS, vbox); |
317 gaim_button(_("_Raise Window on Events"), &blist_options, OPT_BLIST_POPUP, vbox); | |
3366 | 318 |
3427 | 319 vbox = make_frame (ret, _("Group Display")); |
3818 | 320 gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); |
321 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); | |
3366 | 322 |
3427 | 323 vbox = make_frame (ret, _("Buddy Display")); |
3818 | 324 gaim_button(_("Show buddy type _icons"), &blist_options, OPT_BLIST_SHOW_PIXMAPS, vbox); |
325 gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
326 gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
327 gaim_button(_("Grey i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); | |
3366 | 328 |
3427 | 329 gtk_widget_show_all(ret); |
3366 | 330 return ret; |
331 } | |
332 | |
333 GtkWidget *im_page() { | |
334 GtkWidget *ret; | |
3500 | 335 GtkWidget *vbox; |
3427 | 336 GtkWidget *typingbutton, *widge; |
337 GtkSizeGroup *sg; | |
3366 | 338 |
3427 | 339 ret = gtk_vbox_new(FALSE, 18); |
340 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
341 | |
342 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
343 | |
344 vbox = make_frame (ret, _("Window")); | |
3818 | 345 widge = gaim_dropdown(vbox, "Show _buttons as:", &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
3500 | 346 "Pictures", OPT_IM_BUTTON_XPM, |
3366 | 347 "Text", OPT_IM_BUTTON_TEXT, |
348 "Pictures and text", OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
3427 | 349 gtk_size_group_add_widget(sg, widge); |
350 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
3818 | 351 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
352 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
353 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size.entry_height, 25, 9999, sg); | |
354 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); | |
355 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
3366 | 356 gtk_widget_show (vbox); |
357 | |
3427 | 358 vbox = make_frame (ret, _("Buddy Icons")); |
3818 | 359 gaim_button(_("Hide Buddy _Icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
360 gaim_button(_("Disable Buddy Icon A_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
3366 | 361 |
3427 | 362 vbox = make_frame (ret, _("Display")); |
3818 | 363 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
3366 | 364 |
3427 | 365 vbox = make_frame (ret, _("Typing Notification")); |
3818 | 366 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
3366 | 367 OPT_MISC_STEALTH_TYPING, vbox); |
368 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
3818 | 369 misc_options ^= OPT_MISC_STEALTH_TYPING; |
3366 | 370 |
3427 | 371 gtk_widget_show_all(ret); |
3366 | 372 return ret; |
373 } | |
374 | |
375 GtkWidget *chat_page() { | |
376 GtkWidget *ret; | |
377 GtkWidget *vbox; | |
3427 | 378 GtkWidget *dd; |
379 GtkSizeGroup *sg; | |
3366 | 380 |
3427 | 381 ret = gtk_vbox_new(FALSE, 18); |
382 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 383 |
3427 | 384 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
3366 | 385 |
3427 | 386 vbox = make_frame (ret, _("Window")); |
3818 | 387 dd = gaim_dropdown(vbox, "Show _buttons as:", &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
3500 | 388 "Pictures", OPT_CHAT_BUTTON_XPM, |
3427 | 389 "Text", OPT_CHAT_BUTTON_TEXT, |
390 "Pictures and Text", OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
391 gtk_size_group_add_widget(sg, dd); | |
392 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
3818 | 393 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
394 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
395 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size.entry_height, 25, 9999, sg); | |
396 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
3366 | 397 |
3427 | 398 vbox = make_frame (ret, _("Tab Completion")); |
3818 | 399 gaim_button(_("_Tab-Complete Nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
400 gaim_button(_("_Old-Style Tab Completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
3427 | 401 |
402 vbox = make_frame (ret, _("Display")); | |
3818 | 403 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
404 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
3427 | 405 |
406 gtk_widget_show_all(ret); | |
3366 | 407 return ret; |
408 } | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
409 |
3366 | 410 GtkWidget *tab_page() { |
411 GtkWidget *ret; | |
412 GtkWidget *vbox; | |
3427 | 413 GtkWidget *dd; |
414 GtkSizeGroup *sg; | |
415 ret = gtk_vbox_new(FALSE, 18); | |
416 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 417 |
3427 | 418 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 419 |
3427 | 420 vbox = make_frame (ret, _("IM Tabs")); |
3818 | 421 dd = gaim_dropdown(vbox, "Tab _Placement:", &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
3500 | 422 "Top", 0, |
3366 | 423 "Bottom", OPT_IM_BR_TAB, |
424 "Left", OPT_IM_SIDE_TAB, | |
425 "Right", OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
3427 | 426 gtk_size_group_add_widget(sg, dd); |
3818 | 427 gaim_button(_("Show all _Instant Messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
428 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); | |
3366 | 429 |
3427 | 430 vbox = make_frame (ret, _("Chat Tabs")); |
3818 | 431 dd = gaim_dropdown(vbox, "Tab _Placement:", &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
3500 | 432 "Top", 0, |
3427 | 433 "Bottom", OPT_CHAT_BR_TAB, |
434 "Left", OPT_CHAT_SIDE_TAB, | |
435 "Right", OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
436 gtk_size_group_add_widget(sg, dd); | |
3818 | 437 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
3366 | 438 vbox); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
439 |
3427 | 440 vbox = make_frame (ret, _("Combined Tabs")); |
3818 | 441 gaim_button(_("Show IMs and chats in _same tabbed\nwindow."), &convo_options, OPT_CONVO_COMBINE, vbox); |
3500 | 442 |
3427 | 443 vbox = make_frame (ret, _("Buddy List Tabs")); |
3818 | 444 dd = gaim_dropdown(vbox, "Tab _Placement:", &blist_options, OPT_BLIST_BOTTOM_TAB, |
3500 | 445 "Top", 0, |
3366 | 446 "Bottom", OPT_BLIST_BOTTOM_TAB, NULL); |
3427 | 447 gtk_size_group_add_widget(sg, dd); |
3500 | 448 |
3427 | 449 gtk_widget_show_all(ret); |
3366 | 450 return ret; |
451 } | |
452 | |
453 GtkWidget *proxy_page() { | |
454 GtkWidget *ret; | |
455 GtkWidget *vbox; | |
456 GtkWidget *entry; | |
457 GtkWidget *label; | |
458 GtkWidget *hbox; | |
459 GtkWidget *table; | |
460 | |
3427 | 461 ret = gtk_vbox_new(FALSE, 18); |
462 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 463 |
3427 | 464 vbox = make_frame (ret, _("Proxy Type")); |
3818 | 465 gaim_dropdown(vbox, "Proxy _Type:", &proxytype, -1, |
3500 | 466 "No Proxy", PROXY_NONE, |
3366 | 467 "SOCKS 4", PROXY_SOCKS4, |
468 "SOCKS 5", PROXY_SOCKS5, | |
469 "HTTP", PROXY_HTTP, NULL); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
470 |
2254 | 471 table = gtk_table_new(2, 2, FALSE); |
472 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
473 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
474 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | |
475 | |
3427 | 476 vbox = make_frame(ret, _("Proxy Server")); |
477 prefs_proxy_frame = vbox; | |
2254 | 478 |
479 if (proxytype == PROXY_NONE) | |
3427 | 480 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
2254 | 481 |
482 table = gtk_table_new(2, 4, FALSE); | |
483 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
484 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
485 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
3427 | 486 gtk_container_add(GTK_CONTAINER(vbox), table); |
2254 | 487 |
488 | |
3427 | 489 label = gtk_label_new_with_mnemonic(_("_Host")); |
2254 | 490 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
491 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
492 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
493 entry = gtk_entry_new(); |
3427 | 494 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 495 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
496 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
497 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYHOST); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
498 gtk_entry_set_text(GTK_ENTRY(entry), proxyhost); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
499 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
500 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
501 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
502 |
3427 | 503 label = gtk_label_new_with_mnemonic(_("Port")); |
2254 | 504 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
505 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
506 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
507 entry = gtk_entry_new(); |
3427 | 508 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 509 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
510 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
511 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPORT); |
2254 | 512 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
513 if (proxyport) { |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
514 char buf[128]; |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
515 g_snprintf(buf, sizeof(buf), "%d", proxyport); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
516 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
517 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
518 |
3427 | 519 label = gtk_label_new_with_mnemonic(_("_User")); |
2254 | 520 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
521 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
522 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
523 entry = gtk_entry_new(); |
3427 | 524 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 525 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
526 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
527 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYUSER); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
528 gtk_entry_set_text(GTK_ENTRY(entry), proxyuser); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
529 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
530 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
531 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
532 |
3427 | 533 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
2254 | 534 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
535 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
536 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
537 entry = gtk_entry_new(); |
3427 | 538 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 539 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
540 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
541 gtk_signal_connect(GTK_OBJECT(entry), "changed", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
542 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPASS); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
543 gtk_entry_set_text(GTK_ENTRY(entry), proxypass); |
3500 | 544 |
3427 | 545 gtk_widget_show_all(ret); |
3366 | 546 return ret; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
547 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
548 |
3821 | 549 #ifndef _WIN32 |
3432 | 550 static void browser_print_option(GtkEntry *entry, void *nullish) { |
3818 | 551 g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(entry)); |
3432 | 552 } |
3821 | 553 #endif |
3432 | 554 |
3366 | 555 GtkWidget *browser_page() { |
556 GtkWidget *ret; | |
3821 | 557 GtkWidget *vbox; |
558 #ifndef _WIN32 | |
559 GtkWidget *hbox; | |
560 #endif | |
3366 | 561 GtkWidget *label; |
3427 | 562 GtkSizeGroup *sg; |
563 | |
564 ret = gtk_vbox_new(FALSE, 18); | |
565 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
566 | |
567 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
3630 | 568 #ifndef _WIN32 |
569 /* Registered default browser is used by Windows */ | |
3427 | 570 vbox = make_frame (ret, _("Browser Selection")); |
3818 | 571 label = gaim_dropdown(vbox, "_Browser", &web_browser, -1, |
3427 | 572 "Netscape", BROWSER_NETSCAPE, |
573 "Konqueror", BROWSER_KONQ, | |
574 "Mozilla", BROWSER_MOZILLA, | |
575 "Manual", BROWSER_MANUAL, | |
3472 | 576 /* fixme: GNOME binary helper |
577 "GNOME URL Handler", BROWSER_GNOME, */ | |
3427 | 578 "Galeon", BROWSER_GALEON, |
579 "Opera", BROWSER_OPERA, NULL); | |
580 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
581 gtk_size_group_add_widget(sg, label); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
582 |
3366 | 583 hbox = gtk_hbox_new(FALSE, 5); |
584 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
3427 | 585 label = gtk_label_new_with_mnemonic("_Manual: "); |
3366 | 586 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 587 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
588 gtk_size_group_add_widget(sg, label); | |
3366 | 589 browser_entry = gtk_entry_new(); |
3427 | 590 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3818 | 591 if (web_browser != BROWSER_MANUAL) |
3366 | 592 gtk_widget_set_sensitive(browser_entry, FALSE); |
593 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
594 |
3818 | 595 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
3432 | 596 gtk_signal_connect(GTK_OBJECT(browser_entry), "changed", |
597 GTK_SIGNAL_FUNC(browser_print_option), NULL); | |
3630 | 598 #endif /* end !_WIN32 */ |
3427 | 599 vbox = make_frame (ret, _("Browser Options")); |
3818 | 600 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
3630 | 601 #ifdef _WIN32 |
602 /* Until I figure out how to implement this on windows */ | |
603 gtk_widget_set_sensitive(label, FALSE); | |
604 #endif | |
3427 | 605 gtk_widget_show_all(ret); |
3366 | 606 return ret; |
3500 | 607 } |
3366 | 608 |
609 GtkWidget *logging_page() { | |
610 GtkWidget *ret; | |
611 GtkWidget *vbox; | |
3427 | 612 ret = gtk_vbox_new(FALSE, 18); |
613 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
614 |
3427 | 615 vbox = make_frame (ret, _("Message Logs")); |
3818 | 616 gaim_button(_("_Log all Instant Messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
617 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); | |
618 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
619 |
3427 | 620 vbox = make_frame (ret, _("System Logs")); |
3818 | 621 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
3366 | 622 vbox); |
3818 | 623 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
3366 | 624 vbox); |
3818 | 625 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
626 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
3366 | 627 vbox); |
3818 | 628 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
3366 | 629 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
630 |
3427 | 631 gtk_widget_show_all(ret); |
3366 | 632 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
633 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
634 |
3366 | 635 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
636 |
3821 | 637 #ifndef _WIN32 |
3366 | 638 static gint sound_cmd_yeah(GtkEntry *entry, GdkEvent *event, gpointer d) |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
639 { |
3818 | 640 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
3366 | 641 return TRUE; |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
642 } |
3821 | 643 #endif |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
644 |
3366 | 645 GtkWidget *sound_page() { |
646 GtkWidget *ret; | |
3821 | 647 GtkWidget *vbox; |
648 GtkSizeGroup *sg; | |
649 #ifndef _WIN32 | |
650 GtkWidget *dd; | |
651 GtkWidget *hbox; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
652 GtkWidget *label; |
3821 | 653 #endif |
3366 | 654 |
3427 | 655 ret = gtk_vbox_new(FALSE, 18); |
656 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
657 |
3427 | 658 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
659 |
3427 | 660 vbox = make_frame (ret, _("Sound Options")); |
3818 | 661 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
662 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
663 |
3630 | 664 #ifndef _WIN32 |
3427 | 665 vbox = make_frame (ret, _("Sound Method")); |
3818 | 666 dd = gaim_dropdown(vbox, "_Method", &sound_options, OPT_SOUND_BEEP | |
3366 | 667 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL | |
3500 | 668 OPT_SOUND_CMD, |
3366 | 669 "Console Beep", OPT_SOUND_BEEP, |
670 #ifdef ESD_SOUND | |
3500 | 671 "ESD", OPT_SOUND_ESD, |
3366 | 672 #endif /* ESD_SOUND */ |
673 "ArtsC", OPT_SOUND_ARTSC, | |
674 #ifdef NAS_SOUND | |
675 "NAS", OPT_SOUND_NAS, | |
3500 | 676 #endif /* NAS_SOUND */ |
3366 | 677 "Internal", OPT_SOUND_NORMAL, |
678 "Command", OPT_SOUND_CMD, NULL); | |
3427 | 679 gtk_size_group_add_widget(sg, dd); |
680 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
681 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
682 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
683 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 684 |
3366 | 685 hbox = gtk_hbox_new(FALSE, 5); |
686 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 687 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 688 gtk_size_group_add_widget(sg, label); |
689 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 690 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
|
691 |
3366 | 692 sndcmd = gtk_entry_new(); |
3427 | 693 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
694 |
3366 | 695 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
696 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd); | |
697 gtk_widget_set_size_request(sndcmd, 75, -1); | |
3427 | 698 |
3818 | 699 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
3366 | 700 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
701 gtk_signal_connect(GTK_OBJECT(sndcmd), "focus_out_event", GTK_SIGNAL_FUNC(sound_cmd_yeah), NULL); | |
3630 | 702 #endif /* _WIN32 */ |
3427 | 703 gtk_widget_show_all(ret); |
3366 | 704 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
705 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
706 |
3366 | 707 GtkWidget *away_page() { |
708 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
709 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
710 GtkWidget *hbox; |
3366 | 711 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
712 GtkWidget *button; |
3366 | 713 GtkWidget *select; |
3427 | 714 GtkWidget *dd; |
715 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
716 |
3427 | 717 ret = gtk_vbox_new(FALSE, 18); |
718 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
719 |
3427 | 720 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
721 |
3427 | 722 vbox = make_frame (ret, _("Away")); |
3818 | 723 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
724 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
725 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
|
726 |
3427 | 727 vbox = make_frame (ret, _("Auto-response")); |
3366 | 728 hbox = gtk_hbox_new(FALSE, 0); |
729 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 730 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
3818 | 731 &away_resend, 1, 24 * 60 * 60, sg); |
732 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
733 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
734 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
|
735 |
3818 | 736 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
3366 | 737 gtk_widget_set_sensitive(hbox, FALSE); |
3500 | 738 |
3427 | 739 vbox = make_frame (ret, _("Idle")); |
3818 | 740 dd = gaim_dropdown(vbox, "Idle _Time Reporting:", &report_idle, -1, |
3427 | 741 "None", IDLE_NONE, |
3500 | 742 "Gaim Usage", IDLE_GAIM, |
3366 | 743 #ifdef USE_SCREENSAVER |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
744 #ifndef _WIN32 |
3500 | 745 "X Usage", IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
746 #else |
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
747 "Windows Usage", IDLE_SCREENSAVER, |
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
748 #endif |
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); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1326 gaim_setup_imhtml(away_text); |
3366 | 1327 gtk_imhtml_set_defaults(GTK_IMHTML(away_text), NULL, NULL, NULL); |
1328 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1329 g_signal_connect (G_OBJECT (sel), "changed", | |
1330 G_CALLBACK (away_message_sel), | |
1331 NULL); | |
1332 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1333 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1334 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1335 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1336 gtk_size_group_add_widget(sg, button); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1337 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); |
3472 | 1338 |
3366 | 1339 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1340 gtk_size_group_add_widget(sg, button); |
3366 | 1341 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), event_view); |
3472 | 1342 |
3366 | 1343 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1344 |
3649 | 1345 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL); |
3427 | 1346 gtk_size_group_add_widget(sg, button); |
3374 | 1347 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), event_view); |
3366 | 1348 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1349 |
3427 | 1350 gtk_widget_show_all(ret); |
3366 | 1351 return ret; |
1352 } | |
3472 | 1353 |
3500 | 1354 GtkTreeIter *prefs_notebook_add_page(char *text, |
1355 GdkPixbuf *pixbuf, | |
1356 GtkWidget *page, | |
3366 | 1357 GtkTreeIter *iter, |
3500 | 1358 GtkTreeIter *parent, |
3366 | 1359 int ind) { |
1360 GdkPixbuf *icon = NULL; | |
3500 | 1361 |
3366 | 1362 if (pixbuf) |
3500 | 1363 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
|
1364 |
3366 | 1365 gtk_tree_store_append (prefstree, iter, parent); |
1366 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1367 |
3366 | 1368 if (pixbuf) |
1369 g_object_unref(pixbuf); | |
1370 if (icon) | |
1371 g_object_unref(icon); | |
1372 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1373 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1374 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1375 |
3366 | 1376 void prefs_notebook_init() { |
1377 GtkTreeIter p, c; | |
3565 | 1378 #if USE_PLUGINS |
1379 GtkWidget *(*config)(); | |
1380 GList *l = plugins; | |
1381 struct gaim_plugin *plug; | |
1382 #endif | |
1383 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
1384 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | |
1385 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1386 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1387 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
1388 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++); | |
1389 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, notebook_page++); | |
1390 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, notebook_page++); | |
1391 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | |
1392 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
|
1393 |
3565 | 1394 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
1395 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1396 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1397 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1398 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
3551 | 1399 #if USE_PLUGINS |
3565 | 1400 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
1401 while (l) { | |
1402 plug = l->data; | |
1403 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
1404 plug->iter = g_new0(GtkTreeIter, 1); | |
1405 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
1406 } | |
1407 l = l->next; | |
1408 } | |
3551 | 1409 #endif |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1410 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1411 |
3500 | 1412 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1413 { |
3366 | 1414 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1415 GtkWidget *hbox; |
3366 | 1416 GtkWidget *frame; |
1417 GtkTreeViewColumn *column; | |
1418 GtkCellRenderer *cell; | |
1419 GtkTreeSelection *sel; | |
1420 GtkWidget *notebook; | |
1421 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1422 GtkWidget *button; |
3515 | 1423 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
3500 | 1424 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1425 if (prefs) { |
3472 | 1426 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1427 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1428 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1429 |
3366 | 1430 /* copy the preferences to tmp values... |
1431 * I liked "take affect immediately" Oh well :-( */ | |
3818 | 1432 |
1433 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
3500 | 1434 |
3366 | 1435 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1436 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
905 | 1437 gtk_window_set_wmclass(GTK_WINDOW(prefs), "preferences", "Gaim"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1438 gtk_widget_realize(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1439 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
3366 | 1440 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1441 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
|
1442 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1443 vbox = gtk_vbox_new(FALSE, 5); |
1185 | 1444 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1445 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1446 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1447 |
3366 | 1448 hbox = gtk_hbox_new (FALSE, 6); |
1449 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1450 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1451 gtk_widget_show (hbox); | |
1452 | |
1453 frame = gtk_frame_new (NULL); | |
1454 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1455 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1456 gtk_widget_show (frame); | |
3500 | 1457 |
3366 | 1458 /* The tree -- much inspired by the Gimp */ |
1459 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1460 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1461 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1462 | |
1463 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1464 gtk_widget_show(tree_v); | |
1465 /* icons */ | |
1466 cell = gtk_cell_renderer_pixbuf_new (); | |
1467 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
3500 | 1468 |
3366 | 1469 /* text */ |
1470 cell = gtk_cell_renderer_text_new (); | |
1471 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1472 |
3366 | 1473 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
|
1474 |
3472 | 1475 /* The right side */ |
1476 frame = gtk_frame_new (NULL); | |
1477 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1478 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1479 gtk_widget_show (frame); | |
3500 | 1480 |
3472 | 1481 vbox2 = gtk_vbox_new (FALSE, 4); |
1482 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1483 gtk_widget_show (vbox2); | |
3500 | 1484 |
3472 | 1485 frame = gtk_frame_new (NULL); |
1486 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1487 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1488 gtk_widget_show (frame); | |
3500 | 1489 |
3472 | 1490 hbox = gtk_hbox_new (FALSE, 4); |
1491 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1492 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1493 gtk_widget_show (hbox); | |
3500 | 1494 |
3472 | 1495 preflabel = gtk_label_new(NULL); |
1496 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1497 gtk_widget_show (preflabel); | |
3500 | 1498 |
3472 | 1499 /* The notebook */ |
1500 prefsnotebook = notebook = gtk_notebook_new (); | |
1501 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1502 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1503 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
|
1504 |
3472 | 1505 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1506 g_signal_connect (G_OBJECT (sel), "changed", | |
1507 G_CALLBACK (pref_nb_select), | |
1508 notebook); | |
3500 | 1509 gtk_widget_show(notebook); |
3472 | 1510 sep = gtk_hseparator_new(); |
1511 gtk_widget_show(sep); | |
1512 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1513 |
3818 | 1514 /* The buttons^H to press! */ |
3472 | 1515 hbox = gtk_hbox_new (FALSE, 6); |
1516 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1517 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1518 gtk_widget_show (hbox); |
3377 | 1519 |
3818 | 1520 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
3515 | 1521 gtk_size_group_add_widget(sg, button); |
1522 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), prefs); | |
1523 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
1524 gtk_widget_show(button); | |
1525 | |
3500 | 1526 prefs_notebook_init(); |
3427 | 1527 |
3472 | 1528 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1529 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1530 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1531 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1532 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
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 if (debugbutton) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1535 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1536 if (misc_options & OPT_MISC_DEBUG) { |
3818 | 1537 misc_options ^= OPT_MISC_DEBUG; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1538 save_prefs(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1539 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1540 g_free(dw); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1541 dw = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1542 return FALSE; |
1 | 1543 |
1544 } | |
1545 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1546 static void build_debug() |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1547 { |
4005 | 1548 GtkWidget *sw; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1549 GtkWidget *box; |
4005 | 1550 GtkTextBuffer *buffer; |
1551 GtkTextIter end; | |
1552 | |
652
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); |
4005 | 1557 gtk_window_set_default_size(GTK_WINDOW(dw->window), 500, 200); |
1558 gtk_window_set_role(GTK_WINDOW(dw->window), "debug"); | |
1559 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim - Debug Window")); | |
1560 g_signal_connect(G_OBJECT(dw->window), "delete_event", G_CALLBACK(debug_delete), NULL); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1561 |
4005 | 1562 sw = gtk_scrolled_window_new(NULL, NULL); |
1563 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
1564 GTK_POLICY_NEVER, | |
1565 GTK_POLICY_ALWAYS); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1566 |
4005 | 1567 dw->entry = gtk_text_view_new(); |
1568 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1569 gtk_text_view_set_editable(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1570 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(dw->entry), GTK_WRAP_WORD); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1571 |
4005 | 1572 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1573 gtk_text_buffer_get_end_iter(buffer, &end); | |
1574 gtk_text_buffer_create_mark(buffer, "end", &end, FALSE); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1575 |
4005 | 1576 gtk_container_add(GTK_CONTAINER(sw), dw->entry); |
1577 gtk_container_add(GTK_CONTAINER(dw->window), sw); | |
1578 gtk_widget_show_all(dw->window); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1579 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1580 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1581 void show_debug() |
1 | 1582 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1583 if ((misc_options & OPT_MISC_DEBUG)) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1584 if (!dw || !dw->window) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1585 build_debug(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1586 gtk_widget_show(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1587 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1588 if (!dw) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1589 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1590 gtk_widget_destroy(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1591 dw->window = NULL; |
652
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 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1594 |
970 | 1595 void debug_printf(char *fmt, ...) |
1596 { | |
1597 va_list ap; | |
1598 gchar *s; | |
1599 | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1600 va_start(ap, fmt); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1601 s = g_strdup_vprintf(fmt, ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1602 va_end(ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1603 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1604 if (misc_options & OPT_MISC_DEBUG && dw) { |
4005 | 1605 GtkTextBuffer *buffer; |
1606 GtkTextMark *endmark; | |
1607 GtkTextIter end; | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1608 |
4005 | 1609 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1610 endmark = gtk_text_buffer_get_mark(buffer, "end"); | |
1611 gtk_text_buffer_get_iter_at_mark(buffer, &end, endmark); | |
1612 gtk_text_buffer_insert(buffer, &end, s, -1); | |
1613 gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(dw->entry), endmark); | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1614 } |
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1615 if (opt_debug) |
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1616 g_print("%s", s); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1617 g_free(s); |
970 | 1618 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1619 |
1 | 1620 void set_option(GtkWidget *w, int *option) |
1621 { | |
1622 *option = !(*option); | |
1623 } | |
1624 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1625 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1626 { |
3818 | 1627 misc_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1628 |
3818 | 1629 if (option == OPT_MISC_DEBUG) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1630 show_debug(); |
3818 | 1631 |
1632 save_prefs(); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1633 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1634 |
3818 | 1635 static void set_logging_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1636 { |
3818 | 1637 logging_options ^= option; |
3500 | 1638 |
3818 | 1639 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
1640 update_log_convs(); | |
3500 | 1641 |
3818 | 1642 save_prefs(); |
3366 | 1643 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1644 |
3818 | 1645 static void set_blist_option(GtkWidget *w, int option) |
3366 | 1646 { |
3818 | 1647 blist_options ^= option; |
3500 | 1648 |
3818 | 1649 save_prefs(); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1650 |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1651 if (!blist) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1652 return; |
3500 | 1653 |
3818 | 1654 if (option == OPT_BLIST_NO_BUTTONS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1655 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1656 |
3818 | 1657 if (option == OPT_BLIST_SHOW_GRPNUM) |
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1658 update_num_groups(); |
9 | 1659 |
3818 | 1660 if (option == OPT_BLIST_NO_MT_GRP) |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1661 toggle_show_empty_groups(); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1662 |
3818 | 1663 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
|
1664 update_button_pix(); |
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1665 |
3818 | 1666 if (option == OPT_BLIST_SHOW_PIXMAPS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1667 toggle_buddy_pixmaps(); |
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1668 |
3818 | 1669 if ((option == OPT_BLIST_GREY_IDLERS) || (option == OPT_BLIST_SHOW_IDLETIME)) |
2594 | 1670 update_idle_times(); |
3032 | 1671 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1672 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1673 |
3818 | 1674 static void set_convo_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1675 { |
3818 | 1676 convo_options ^= option; |
3500 | 1677 |
3818 | 1678 if (option == OPT_CONVO_SHOW_SMILEY) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1679 toggle_smileys(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1680 |
3818 | 1681 if (option == OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1682 toggle_timestamps(); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
1683 |
3818 | 1684 if (option == OPT_CONVO_CHECK_SPELLING) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1685 toggle_spellchk(); |
572
faca21605e1b
[gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
1686 |
3818 | 1687 save_prefs(); |
1688 } | |
1689 | |
1690 static void set_im_option(GtkWidget *w, int option) | |
1691 { | |
1692 im_options ^= option; | |
3500 | 1693 |
3818 | 1694 if (option == OPT_IM_ONE_WINDOW) |
1695 im_tabize(); | |
1696 | |
1697 if (option == OPT_IM_HIDE_ICONS) | |
1698 set_hide_icons(); | |
1699 | |
1700 if (option == OPT_IM_ALIAS_TAB) { | |
1701 set_convo_titles(); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1702 } |
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1703 |
3818 | 1704 if (option == OPT_IM_NO_ANIMATION) |
3013 | 1705 set_anim(); |
3500 | 1706 |
3818 | 1707 save_prefs(); |
1 | 1708 } |
1709 | |
3818 | 1710 static void set_chat_option(GtkWidget *w, int option) |
1 | 1711 { |
3818 | 1712 chat_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1713 |
3818 | 1714 if (option == OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1715 chat_tabize(); |
3500 | 1716 |
3818 | 1717 save_prefs(); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1718 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1719 |
3818 | 1720 void set_sound_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1721 { |
3818 | 1722 sound_options ^= option; |
3500 | 1723 |
3818 | 1724 save_prefs(); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1725 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1726 |
3818 | 1727 static void set_font_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1728 { |
3818 | 1729 font_options ^= option; |
3500 | 1730 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1731 update_font_buttons(); |
3818 | 1732 |
1733 save_prefs(); | |
1 | 1734 } |
1735 | |
3818 | 1736 static void set_away_option(GtkWidget *w, int option) |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1737 { |
3818 | 1738 away_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1739 |
3818 | 1740 if (option == OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1741 toggle_away_queue(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1742 |
3818 | 1743 save_prefs(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1744 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
1745 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1746 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 1747 { |
1748 GtkWidget *button; | |
3427 | 1749 button = gtk_check_button_new_with_mnemonic(text); |
1 | 1750 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
1751 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
3366 | 1752 gtk_object_set_user_data(GTK_OBJECT(button), options); |
1 | 1753 |
3818 | 1754 if (options == &misc_options) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1755 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
|
1756 (int *)option); |
3818 | 1757 if (options == &logging_options) |
1758 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_logging_option), | |
1759 (int *)option); | |
1760 if (options == &blist_options) | |
1761 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_blist_option), | |
1762 (int *)option); | |
1763 if (options == &convo_options) | |
1764 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_convo_option), | |
1765 (int *)option); | |
1766 if (options == &im_options) | |
1767 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_im_option), | |
1768 (int *)option); | |
1769 if (options == &chat_options) | |
1770 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_chat_option), | |
1771 (int *)option); | |
1772 if (options == &font_options) | |
1773 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_font_option), | |
1774 (int *)option); | |
1775 if (options == &sound_options) | |
1776 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option), | |
1777 (int *)option); | |
1778 if (options == &away_options) | |
1779 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
|
1780 (int *)option); |
3500 | 1781 |
1 | 1782 gtk_widget_show(button); |
1783 | |
1784 return button; | |
1785 } | |
1786 | |
3366 | 1787 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
1788 {} | |
1789 void default_away_menu_init(GtkWidget *omenu) | |
3032 | 1790 { |
3366 | 1791 GtkWidget *menu, *opt; |
1792 int index = 0; | |
1793 GSList *awy = away_messages; | |
1794 struct away_message *a; | |
1795 | |
1796 menu = gtk_menu_new(); | |
1797 | |
1798 while (awy) { | |
1799 a = (struct away_message *)awy->data; | |
1800 opt = gtk_menu_item_new_with_label(a->name); | |
1801 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_default_away), | |
1802 (gpointer)index); | |
1803 gtk_widget_show(opt); | |
1804 gtk_menu_append(GTK_MENU(menu), opt); | |
1805 | |
1806 awy = awy->next; | |
1807 index++; | |
1808 } | |
1809 | |
1810 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
1811 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
1812 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
1813 } | |
1814 | |
1815 GtkWidget *pref_fg_picture = NULL; | |
1816 GtkWidget *pref_bg_picture = NULL; | |
1817 | |
1818 void destroy_colorsel(GtkWidget *w, gpointer d) | |
1819 { | |
1820 if (d) { | |
1821 gtk_widget_destroy(fgcseld); | |
1822 fgcseld = NULL; | |
1823 } else { | |
1824 gtk_widget_destroy(bgcseld); | |
1825 bgcseld = NULL; | |
1826 } | |
3032 | 1827 } |
1828 | |
3366 | 1829 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 1830 { |
3366 | 1831 if ((int)d == 1) { |
1832 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1833 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3818 | 1834 &fgcolor); |
3366 | 1835 destroy_colorsel(NULL, (void *)1); |
1836 update_color(NULL, pref_fg_picture); | |
1837 } else { | |
1838 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 1839 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3818 | 1840 &bgcolor); |
3366 | 1841 destroy_colorsel(NULL, (void *)0); |
1842 update_color(NULL, pref_bg_picture); | |
1843 } | |
3032 | 1844 } |
1845 | |
3366 | 1846 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 1847 { |
3366 | 1848 GdkColor c; |
1849 GtkStyle *style; | |
1850 c.pixel = 0; | |
3500 | 1851 |
3366 | 1852 if (pic == pref_fg_picture) { |
3818 | 1853 if (font_options & OPT_FONT_FGCOL) { |
1854 c.red = fgcolor.red; | |
1855 c.blue = fgcolor.blue; | |
1856 c.green = fgcolor.green; | |
3366 | 1857 } else { |
1858 c.red = 0; | |
1859 c.blue = 0; | |
1860 c.green = 0; | |
1861 } | |
1862 } else { | |
3818 | 1863 if (font_options & OPT_FONT_BGCOL) { |
1864 c.red = bgcolor.red; | |
1865 c.blue = bgcolor.blue; | |
1866 c.green = bgcolor.green; | |
3366 | 1867 } else { |
1868 c.red = 0xffff; | |
1869 c.blue = 0xffff; | |
1870 c.green = 0xffff; | |
1871 } | |
1872 } | |
1873 | |
1874 style = gtk_style_new(); | |
1875 style->bg[0] = c; | |
1876 gtk_widget_set_style(pic, style); | |
1877 gtk_style_unref(style); | |
1878 } | |
1879 void set_default_away(GtkWidget *w, gpointer i) | |
1880 { | |
1881 | |
1882 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1883 |
3366 | 1884 if (away_messages == NULL) |
3818 | 1885 default_away = NULL; |
3366 | 1886 else if ((int)i >= length) |
3818 | 1887 default_away = g_slist_nth_data(away_messages, length - 1); |
3366 | 1888 else |
3818 | 1889 default_away = g_slist_nth_data(away_messages, (int)i); |
3366 | 1890 } |
3500 | 1891 |
3366 | 1892 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
1893 { | |
1894 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
1895 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
1896 } | |
3427 | 1897 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 1898 { |
1899 GtkWidget *hbox; | |
1900 GtkWidget *label; | |
1901 GtkWidget *spin; | |
1902 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
1903 |
3366 | 1904 hbox = gtk_hbox_new(FALSE, 5); |
1905 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
1906 gtk_widget_show(hbox); | |
1907 | |
3427 | 1908 label = gtk_label_new_with_mnemonic(title); |
3366 | 1909 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1910 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
1911 |
3366 | 1912 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
1913 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
1914 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
1915 gtk_widget_set_usize(spin, 50, -1); | |
1916 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
1917 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed", | |
1918 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin)); | |
1919 gtk_widget_show(spin); | |
3500 | 1920 |
3427 | 1921 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
1922 | |
1923 if (sg) { | |
1924 gtk_size_group_add_widget(sg, label); | |
1925 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 1926 |
3427 | 1927 } |
1928 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1929 } |
1 | 1930 |
3366 | 1931 void dropdown_set(GtkObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1932 { |
3366 | 1933 int opt = (int)gtk_object_get_user_data(w); |
1934 int clear = (int)gtk_object_get_data(w, "clear"); | |
3500 | 1935 |
3366 | 1936 if (clear != -1) { |
1937 *option = *option & ~clear; | |
1938 *option = *option | opt; | |
1939 } else { | |
1940 debug_printf("HELLO %d\n", opt); | |
1941 *option = opt; | |
1942 } | |
3500 | 1943 |
3818 | 1944 if (option == &proxytype) { |
3366 | 1945 if (opt == PROXY_NONE) |
1946 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
1947 else | |
1948 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
3818 | 1949 } else if (option == &web_browser) { |
3366 | 1950 if (opt == BROWSER_MANUAL) |
1951 gtk_widget_set_sensitive(browser_entry, TRUE); | |
1952 else | |
1953 gtk_widget_set_sensitive(browser_entry, FALSE); | |
3818 | 1954 } else if (option == (int*)&sound_options) { |
3366 | 1955 if (opt == OPT_SOUND_CMD) |
1956 gtk_widget_set_sensitive(sndcmd, TRUE); | |
1957 else | |
1958 gtk_widget_set_sensitive(sndcmd, FALSE); | |
3818 | 1959 } else if (option == (int*)&im_options) { |
1960 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
1961 update_im_tabs(); | |
1962 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) | |
1963 update_im_button_pix(); | |
1964 } else if (option == (int*)&chat_options) { | |
1965 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
1966 update_im_tabs(); | |
1967 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) | |
1968 update_im_button_pix(); | |
1969 } else if (option == (int*)&blist_options) { | |
1970 set_blist_tab(); | |
3366 | 1971 } |
3500 | 1972 |
1 | 1973 } |
1974 | |
3500 | 1975 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 1976 { |
3366 | 1977 va_list menuitems; |
1978 GtkWidget *dropdown, *opt, *menu; | |
1979 GtkWidget *label; | |
1980 gchar *text; | |
1981 int value; | |
1982 int o = 0; | |
1983 GtkWidget *hbox; | |
1 | 1984 |
3366 | 1985 hbox = gtk_hbox_new(FALSE, 5); |
1986 gtk_container_add (GTK_CONTAINER (box), hbox); | |
1987 gtk_widget_show(hbox); | |
1988 | |
3427 | 1989 label = gtk_label_new_with_mnemonic(title); |
3366 | 1990 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
1991 gtk_widget_show(label); | |
1992 | |
1993 va_start(menuitems, clear); | |
1994 text = va_arg(menuitems, gchar *); | |
1995 | |
1996 if (!text) | |
1997 return NULL; | |
3500 | 1998 |
3366 | 1999 dropdown = gtk_option_menu_new(); |
2000 menu = gtk_menu_new(); | |
3500 | 2001 |
3427 | 2002 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 2003 |
3366 | 2004 while (text) { |
2005 value = va_arg(menuitems, int); | |
2006 opt = gtk_menu_item_new_with_label(text); | |
2007 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
2008 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
2009 gtk_signal_connect(GTK_OBJECT(opt), "activate", | |
2010 GTK_SIGNAL_FUNC(dropdown_set), (void *)option); | |
2011 gtk_widget_show(opt); | |
2012 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 2013 |
3366 | 2014 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
2015 gtk_menu_set_active(GTK_MENU(menu), o); | |
2016 } | |
2017 text = va_arg(menuitems, gchar *); | |
2018 o++; | |
2019 } | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2020 |
3366 | 2021 va_end(menuitems); |
1 | 2022 |
3500 | 2023 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 2024 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
2025 gtk_widget_show(dropdown); | |
3427 | 2026 return label; |
3500 | 2027 } |
2028 | |
3366 | 2029 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 2030 { |
3366 | 2031 /* more stuff stolen from X-Chat */ |
2032 GtkWidget *swid; | |
2033 GdkColor c; | |
2034 GtkStyle *style; | |
2035 c.pixel = 0; | |
2036 if (fgc) { | |
3818 | 2037 if (font_options & OPT_FONT_FGCOL) { |
2038 c.red = fgcolor.red; | |
2039 c.blue = fgcolor.blue; | |
2040 c.green = fgcolor.green; | |
3366 | 2041 } else { |
2042 c.red = 0; | |
2043 c.blue = 0; | |
2044 c.green = 0; | |
2045 } | |
2046 } else { | |
3818 | 2047 if (font_options & OPT_FONT_BGCOL) { |
2048 c.red = bgcolor.red; | |
2049 c.blue = bgcolor.blue; | |
2050 c.green = bgcolor.green; | |
3366 | 2051 } else { |
2052 c.red = 0xffff; | |
2053 c.blue = 0xffff; | |
2054 c.green = 0xffff; | |
2055 } | |
2056 } | |
1 | 2057 |
3366 | 2058 style = gtk_style_new(); |
2059 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2060 |
3366 | 2061 swid = gtk_event_box_new(); |
2062 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
2063 gtk_style_unref(style); | |
2064 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); | |
2065 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2066 gtk_widget_show(swid); | |
2067 return swid; | |
1 | 2068 } |
3366 | 2069 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2070 { |
3366 | 2071 int i = 0; |
2072 char *fontname; | |
2073 | |
3473 | 2074 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 2075 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2076 |
3818 | 2077 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
2078 fontface[i] = fontname[i]; | |
3366 | 2079 i++; |
2080 } | |
3818 | 2081 fontface[i] = 0; |
3366 | 2082 g_free(fontname); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2083 } |
3500 | 2084 |