Mercurial > pidgin
annotate src/prefs.c @ 4634:d19872836812
[gaim-migrate @ 4941]
This will let you set up different proxy settings for different accounts.
Mainly useful to the corporate users that need to connect to an internal
jabber server, and still want to connect to "external" stuff through a
proxy, or something along those lines. I'm sure someone will come up with
another use for it.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 02 Mar 2003 18:48:02 +0000 |
parents | fb520992d5a1 |
children | 42d53c416bb9 |
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" |
4561 | 41 #include "sound.h" |
3366 | 42 |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
43 #ifdef _WIN32 |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
44 #include "win32dep.h" |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
45 #endif |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
46 |
3567 | 47 GtkWidget *tree_v = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
48 GtkWidget *prefs_away_list = NULL; |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
49 GtkWidget *prefs_away_menu = NULL; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
50 GtkWidget *preftree = NULL; |
3366 | 51 GtkWidget *fontseld = NULL; |
52 | |
3379 | 53 GtkListStore *prefs_away_store = NULL; |
3366 | 54 |
55 static int sound_row_sel = 0; | |
56 static char *last_sound_dir = NULL; | |
57 | |
58 static GtkWidget *sounddialog = NULL; | |
59 static GtkWidget *browser_entry = NULL; | |
60 static GtkWidget *sound_entry = NULL; | |
61 static GtkWidget *away_text = NULL; | |
4324 | 62 static GtkListStore *smiley_theme_store = NULL; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
63 GtkCTreeNode *general_node = NULL; |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
64 GtkCTreeNode *deny_node = NULL; |
2254 | 65 GtkWidget *prefs_proxy_frame = NULL; |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
66 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
3427 | 67 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
3366 | 68 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
4428 | 69 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *); |
3366 | 70 static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
71 static void delete_prefs(GtkWidget *, void *); | |
72 void set_default_away(GtkWidget *, gpointer); | |
4428 | 73 static gboolean program_is_valid(const char *); |
1026 | 74 |
3366 | 75 struct debug_window *dw = NULL; |
3565 | 76 GtkWidget *prefs = NULL; |
3366 | 77 GtkWidget *debugbutton = NULL; |
3565 | 78 static int notebook_page = 0; |
79 static GtkTreeIter plugin_iter; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
80 |
3630 | 81 /* |
82 * PROTOTYPES | |
83 */ | |
84 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); | |
85 | |
3366 | 86 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
4215 | 87 GList *l = plugins; |
88 struct gaim_plugin *plug; | |
89 | |
4064 | 90 save_prefs(); |
3485 | 91 prefs = NULL; |
3567 | 92 tree_v = NULL; |
3485 | 93 sound_entry = NULL; |
94 browser_entry = NULL; | |
3526 | 95 debugbutton = NULL; |
96 prefs_away_menu = NULL; | |
3565 | 97 notebook_page = 0; |
4324 | 98 smiley_theme_store = NULL; |
3485 | 99 if(sounddialog) |
3379 | 100 gtk_widget_destroy(sounddialog); |
3500 | 101 g_object_unref(G_OBJECT(prefs_away_store)); |
4215 | 102 while(l) { |
103 plug = l->data; | |
104 if(plug->iter) { | |
105 g_free(plug->iter); | |
106 plug->iter = NULL; | |
107 } | |
108 l = l->next; | |
109 } | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
110 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
111 |
3366 | 112 GtkWidget *preflabel; |
113 GtkWidget *prefsnotebook; | |
114 GtkTreeStore *prefstree; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
115 |
3818 | 116 static void set_misc_option(); |
117 static void set_logging_option(); | |
118 static void set_blist_option(); | |
119 static void set_convo_option(); | |
120 static void set_im_option(); | |
121 static void set_chat_option(); | |
122 static void set_font_option(); | |
123 static void set_sound_option(); | |
124 static void set_away_option(); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
125 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
126 #define PROXYHOST 0 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
127 #define PROXYPORT 1 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
128 #define PROXYTYPE 2 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
129 #define PROXYUSER 3 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
130 #define PROXYPASS 4 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
131 static void proxy_print_option(GtkEntry *entry, int entrynum) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
132 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
133 if (entrynum == PROXYHOST) |
4634 | 134 g_snprintf(global_proxy_info.proxyhost, sizeof(global_proxy_info.proxyhost), "%s", gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
135 else if (entrynum == PROXYPORT) |
4634 | 136 global_proxy_info.proxyport = atoi(gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
137 else if (entrynum == PROXYUSER) |
4634 | 138 g_snprintf(global_proxy_info.proxyuser, sizeof(global_proxy_info.proxyuser), "%s", gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
139 else if (entrynum == PROXYPASS) |
4634 | 140 g_snprintf(global_proxy_info.proxypass, sizeof(global_proxy_info.proxypass), "%s", gtk_entry_get_text(entry)); |
4137 | 141 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want |
142 to save it */ | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
143 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
144 |
3366 | 145 |
3565 | 146 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
3427 | 147 GtkWidget *vbox, *label, *hbox; |
148 char labeltext[256]; | |
3500 | 149 |
3427 | 150 vbox = gtk_vbox_new(FALSE, 6); |
151 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
152 label = gtk_label_new(NULL); | |
153 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
154 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
155 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
156 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
157 hbox = gtk_hbox_new(FALSE, 6); | |
158 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
159 label = gtk_label_new(" "); | |
160 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
161 vbox = gtk_vbox_new(FALSE, 6); | |
162 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
163 return vbox; | |
164 } | |
165 | |
3366 | 166 /* OK, Apply and Cancel */ |
167 | |
168 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
169 GtkTreeIter iter; | |
3427 | 170 char text[128]; |
3366 | 171 GValue val = { 0, }; |
172 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
3500 | 173 |
3366 | 174 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
175 return; | |
176 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3500 | 177 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
3427 | 178 g_value_get_string(&val)); |
179 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
3366 | 180 g_value_unset (&val); |
181 gtk_tree_model_get_value (model, &iter, 2, &val); | |
182 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
183 | |
184 } | |
185 | |
186 /* These are the pages in the preferences notebook */ | |
187 GtkWidget *interface_page() { | |
188 GtkWidget *ret; | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
189 GtkWidget *vbox; |
3427 | 190 ret = gtk_vbox_new(FALSE, 18); |
191 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 192 |
3427 | 193 vbox = make_frame(ret, _("Interface Options")); |
3500 | 194 |
4227 | 195 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
196 | |
3366 | 197 |
3427 | 198 gtk_widget_show_all(ret); |
3366 | 199 return ret; |
200 } | |
201 | |
4288 | 202 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { |
203 GtkTreeIter iter; | |
4298 | 204 const char *filename; |
4288 | 205 GValue val = { 0, }; |
206 | |
207 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
208 return; | |
209 gtk_tree_model_get_value (model, &iter, 2, &val); | |
210 filename = g_value_get_string(&val); | |
211 load_smiley_theme(filename, TRUE); | |
212 g_value_unset (&val); | |
4302 | 213 save_prefs(); |
4288 | 214 } |
215 | |
4324 | 216 GtkTreePath *theme_refresh_theme_list() |
217 { | |
218 GdkPixbuf *pixbuf; | |
4323 | 219 GSList *themes; |
4288 | 220 GtkTreeIter iter; |
4328 | 221 GtkTreePath *path = NULL; |
4325 | 222 int ind = 0; |
223 | |
4288 | 224 |
4323 | 225 smiley_theme_probe(); |
4328 | 226 |
4323 | 227 if (!smiley_themes) |
4328 | 228 return NULL; |
4325 | 229 |
4323 | 230 themes = smiley_themes; |
4325 | 231 |
232 gtk_list_store_clear(smiley_theme_store); | |
233 | |
4288 | 234 while (themes) { |
235 struct smiley_theme *theme = themes->data; | |
236 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
237 "<span size='smaller' foreground='gray'>%s</span>", | |
238 theme->name, theme->author, theme->desc);; | |
4324 | 239 gtk_list_store_append (smiley_theme_store, &iter); |
4288 | 240 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); |
4328 | 241 |
4324 | 242 gtk_list_store_set(smiley_theme_store, &iter, |
4288 | 243 0, pixbuf, |
244 1, description, | |
245 2, theme->path, | |
246 -1); | |
247 g_free(description); | |
248 themes = themes->next; | |
249 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
250 /* path = gtk_tree_path_new_from_indices(ind); */ | |
251 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
252 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
253 g_free(iwishihadgtk2_2); | |
254 } | |
255 ind++; | |
256 } | |
4325 | 257 |
4324 | 258 return path; |
259 } | |
4325 | 260 |
4326 | 261 void theme_install_theme(char *path, char *extn) { |
4325 | 262 gchar *command; |
263 gchar *destdir; | |
264 gchar *tail; | |
265 | |
266 /* Just to be safe */ | |
267 g_strchomp(path); | |
268 | |
269 /* I dont know what you are, get out of here */ | |
4326 | 270 if (extn != NULL) |
271 tail = extn; | |
272 else if ((tail = strrchr(path, '.')) == NULL) | |
4325 | 273 return; |
274 | |
275 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); | |
276 | |
277 /* We'll check this just to make sure. This also lets us do something different on | |
278 * other platforms, if need be */ | |
279 if (!g_strcasecmp(tail, ".gz") || !g_strcasecmp(tail, ".tgz")) | |
280 command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); | |
281 else { | |
282 g_free(destdir); | |
283 return; | |
284 } | |
285 | |
286 /* Fire! */ | |
287 system(command); | |
288 | |
289 g_free(command); | |
290 g_free(destdir); | |
291 | |
292 theme_refresh_theme_list(); | |
293 } | |
294 | |
4326 | 295 static void theme_got_url(gpointer data, char *themedata, unsigned long len) { |
296 FILE *f; | |
297 gchar *path; | |
298 | |
299 f = gaim_mkstemp(&path); | |
300 fwrite(themedata, len, 1, f); | |
301 fclose(f); | |
302 | |
303 theme_install_theme(path, data); | |
304 | |
305 unlink(path); | |
306 g_free(path); | |
307 } | |
308 | |
4328 | 309 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, |
4325 | 310 guint info, guint t, gpointer data) { |
311 gchar *name = sd->data; | |
312 | |
313 if ((sd->length >= 0) && (sd->format == 8)) { | |
314 /* Well, it looks like the drag event was cool. | |
315 * Let's do something with it */ | |
316 | |
317 if (!g_strncasecmp(name, "file://", 7)) { | |
318 /* It looks like we're dealing with a local file. Let's | |
319 * just untar it in the right place */ | |
4326 | 320 theme_install_theme(name + 7, NULL); |
321 } else if (!g_strncasecmp(name, "http://", 7)) { | |
322 /* Oo, a web drag and drop. This is where things | |
323 * will start to get interesting */ | |
324 gchar *tail; | |
4328 | 325 |
4326 | 326 if ((tail = strrchr(name, '.')) == NULL) |
327 return; | |
328 | |
329 /* We'll check this just to make sure. This also lets us do something different on | |
330 * other platforms, if need be */ | |
4332
c8f374cadbd9
[gaim-migrate @ 4596]
Christian Hammond <chipx86@chipx86.com>
parents:
4330
diff
changeset
|
331 grab_url(name, TRUE, theme_got_url, ".tgz"); |
4325 | 332 } |
333 | |
334 gtk_drag_finish(dc, TRUE, FALSE, t); | |
335 } | |
336 | |
337 gtk_drag_finish(dc, FALSE, FALSE, t); | |
338 } | |
339 | |
4324 | 340 GtkWidget *theme_page() { |
341 GtkWidget *ret; | |
342 GtkWidget *sw; | |
343 GtkWidget *view; | |
344 GtkCellRenderer *rend; | |
345 GtkTreeViewColumn *col; | |
346 GtkTreeSelection *sel; | |
347 GtkTreePath *path = NULL; | |
4334 | 348 GtkWidget *label; |
4325 | 349 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 1, 0},{"STRING", 2, 0}}; |
4324 | 350 |
351 ret = gtk_vbox_new(FALSE, 18); | |
352 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
353 | |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
354 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below. New themes can be installed by dragging and dropping them onto the theme list.")); |
4334 | 355 |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
356 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
4334 | 357 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
358 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
359 | |
360 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
361 gtk_widget_show(label); | |
362 | |
4324 | 363 sw = gtk_scrolled_window_new(NULL,NULL); |
364 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
365 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
366 | |
367 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
368 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
369 | |
370 path = theme_refresh_theme_list(); | |
4288 | 371 |
4324 | 372 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
4325 | 373 |
374 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
375 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
376 | |
377 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
378 | |
4288 | 379 rend = gtk_cell_renderer_pixbuf_new(); |
380 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
4328 | 381 |
382 if(path) { | |
383 gtk_tree_selection_select_path(sel, path); | |
384 gtk_tree_path_free(path); | |
385 } | |
4288 | 386 |
4589 | 387 col = gtk_tree_view_column_new_with_attributes (_("Icon"), |
4288 | 388 rend, |
389 "pixbuf", 0, | |
390 NULL); | |
391 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
392 | |
393 rend = gtk_cell_renderer_text_new(); | |
4589 | 394 col = gtk_tree_view_column_new_with_attributes (_("Description"), |
4288 | 395 rend, |
396 "markup", 1, | |
397 NULL); | |
398 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
4324 | 399 g_object_unref(G_OBJECT(smiley_theme_store)); |
4288 | 400 gtk_container_add(GTK_CONTAINER(sw), view); |
401 | |
402 g_signal_connect (G_OBJECT (sel), "changed", | |
403 G_CALLBACK (smiley_sel), | |
404 NULL); | |
405 | |
406 | |
407 gtk_widget_show_all(ret); | |
408 return ret; | |
409 } | |
410 | |
3366 | 411 GtkWidget *font_page() { |
412 GtkWidget *ret; | |
413 GtkWidget *button; | |
414 GtkWidget *vbox, *hbox; | |
415 GtkWidget *select = NULL; | |
3427 | 416 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 417 |
3427 | 418 ret = gtk_vbox_new(FALSE, 18); |
419 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 420 |
3427 | 421 vbox = make_frame(ret, _("Style")); |
3818 | 422 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
423 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
424 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
4599 | 425 gaim_button(_("_Strikethrough"), &font_options, OPT_FONT_STRIKE, vbox); |
3500 | 426 |
3427 | 427 vbox = make_frame(ret, _("Face")); |
428 hbox = gtk_hbox_new(FALSE, 6); | |
429 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 430 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
3427 | 431 gtk_size_group_add_widget(sg, button); |
432 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
3366 | 433 |
3818 | 434 if (!(font_options & OPT_FONT_FACE)) |
3366 | 435 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
436 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
437 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
438 g_signal_connect(GTK_OBJECT(select), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
439 G_CALLBACK(show_font_dialog), NULL); |
3366 | 440 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
441 | |
442 hbox = gtk_hbox_new(FALSE, 5); | |
443 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 444 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
3427 | 445 gtk_size_group_add_widget(sg, button); |
3818 | 446 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
447 if (!(font_options & OPT_FONT_SIZE)) | |
3366 | 448 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
449 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
450 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 451 |
3500 | 452 vbox = make_frame(ret, _("Color")); |
3366 | 453 hbox = gtk_hbox_new(FALSE, 5); |
454 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 455 |
456 | |
3818 | 457 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
3427 | 458 gtk_size_group_add_widget(sg, button); |
459 | |
460 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
461 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 462 pref_fg_picture = show_color_pref(hbox, TRUE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
463 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 464 pref_fg_picture); |
3427 | 465 |
3818 | 466 if (!(font_options & OPT_FONT_FGCOL)) |
3366 | 467 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
468 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
469 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
470 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
3366 | 471 hbox = gtk_hbox_new(FALSE, 5); |
472 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 473 |
3818 | 474 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
3427 | 475 gtk_size_group_add_widget(sg, button); |
476 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
477 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 478 pref_bg_picture = show_color_pref(hbox, FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
479 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 480 pref_bg_picture); |
3472 | 481 |
3818 | 482 if (!(font_options & OPT_FONT_BGCOL)) |
3366 | 483 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
484 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
485 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
486 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 487 |
3427 | 488 gtk_widget_show_all(ret); |
3366 | 489 return ret; |
490 } | |
491 | |
492 | |
493 GtkWidget *messages_page() { | |
494 GtkWidget *ret; | |
495 GtkWidget *vbox; | |
3427 | 496 ret = gtk_vbox_new(FALSE, 18); |
497 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 498 |
3427 | 499 vbox = make_frame (ret, _("Display")); |
3818 | 500 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
501 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
502 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
3803 | 503 #ifdef USE_GTKSPELL |
3818 | 504 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
3803 | 505 #endif |
3427 | 506 vbox = make_frame (ret, _("Ignore")); |
3818 | 507 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
508 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
509 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
510 /* gaim_button(_("Ignore Ti_K Automated Messages"), &away_options, OPT_AWAY_TIK_HACK, vbox); */ | |
3500 | 511 |
3427 | 512 gtk_widget_show_all(ret); |
3366 | 513 return ret; |
514 } | |
515 | |
516 GtkWidget *hotkeys_page() { | |
517 GtkWidget *ret; | |
518 GtkWidget *vbox; | |
3427 | 519 ret = gtk_vbox_new(FALSE, 18); |
520 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 521 |
3427 | 522 vbox = make_frame(ret, _("Send Message")); |
3818 | 523 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
524 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
3500 | 525 |
3427 | 526 vbox = make_frame (ret, _("Window Closing")); |
3818 | 527 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
528 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
3366 | 529 |
3427 | 530 vbox = make_frame(ret, "Insertions"); |
3818 | 531 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
532 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
|
533 |
3427 | 534 gtk_widget_show_all(ret); |
3366 | 535 return ret; |
536 } | |
537 | |
538 GtkWidget *list_page() { | |
539 GtkWidget *ret; | |
540 GtkWidget *vbox; | |
3427 | 541 ret = gtk_vbox_new(FALSE, 18); |
542 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 543 |
3427 | 544 vbox = make_frame (ret, _("Buttons")); |
3818 | 545 gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options, OPT_BLIST_NO_BUTTONS, vbox); |
546 gaim_button(_("Show _pictures on buttons"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM, vbox); | |
3366 | 547 |
3427 | 548 vbox = make_frame (ret, _("Buddy List Window")); |
4045 | 549 gaim_button(_("_Save window size/position"), &blist_options, OPT_BLIST_SAVED_WINDOWS, vbox); |
550 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); | |
3366 | 551 |
3427 | 552 vbox = make_frame (ret, _("Group Display")); |
3818 | 553 gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); |
554 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); | |
3366 | 555 |
3427 | 556 vbox = make_frame (ret, _("Buddy Display")); |
3818 | 557 gaim_button(_("Show buddy type _icons"), &blist_options, OPT_BLIST_SHOW_PIXMAPS, vbox); |
558 gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
559 gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
560 gaim_button(_("Grey i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); | |
3366 | 561 |
3427 | 562 gtk_widget_show_all(ret); |
3366 | 563 return ret; |
564 } | |
565 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
566 GtkWidget *conv_page() { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
567 GtkWidget *ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
568 GtkWidget *vbox; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
569 GtkWidget *label; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
570 GtkSizeGroup *sg; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
571 GList *names = NULL; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
572 int i; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
573 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
574 ret = gtk_vbox_new(FALSE, 18); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
575 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
576 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
577 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
578 vbox = make_frame(ret, _("Conversations")); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
579 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
580 /* Build a list of names. */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
581 for (i = 0; i < gaim_conv_placement_get_fnc_count(); i++) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
582 names = g_list_append(names, (char *)gaim_conv_placement_get_name(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
583 names = g_list_append(names, GINT_TO_POINTER(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
584 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
585 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
586 label = gaim_dropdown_from_list(vbox, _("_Placement:"), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
587 &conv_placement_option, -1, names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
588 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
589 g_list_free(names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
590 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
591 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
592 gtk_size_group_add_widget(sg, label); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
593 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
594 gaim_button(_("Show IMs and chats in _same tabbed window."), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
595 &convo_options, OPT_CONVO_COMBINE, vbox); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
596 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
597 gtk_widget_show_all(ret); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
598 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
599 return ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
600 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
601 |
3366 | 602 GtkWidget *im_page() { |
603 GtkWidget *ret; | |
3500 | 604 GtkWidget *vbox; |
3427 | 605 GtkWidget *typingbutton, *widge; |
606 GtkSizeGroup *sg; | |
3366 | 607 |
3427 | 608 ret = gtk_vbox_new(FALSE, 18); |
609 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
610 | |
611 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
612 | |
613 vbox = make_frame (ret, _("Window")); | |
4114 | 614 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
615 _("Pictures"), OPT_IM_BUTTON_XPM, | |
616 _("Text"), OPT_IM_BUTTON_TEXT, | |
617 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
3427 | 618 gtk_size_group_add_widget(sg, widge); |
619 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
3818 | 620 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
621 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
622 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size.entry_height, 25, 9999, sg); | |
623 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); | |
624 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
3366 | 625 gtk_widget_show (vbox); |
626 | |
3427 | 627 vbox = make_frame (ret, _("Buddy Icons")); |
4045 | 628 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
629 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
3366 | 630 |
3427 | 631 vbox = make_frame (ret, _("Display")); |
3818 | 632 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
3366 | 633 |
3427 | 634 vbox = make_frame (ret, _("Typing Notification")); |
3818 | 635 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
3366 | 636 OPT_MISC_STEALTH_TYPING, vbox); |
637 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
3818 | 638 misc_options ^= OPT_MISC_STEALTH_TYPING; |
3366 | 639 |
3427 | 640 gtk_widget_show_all(ret); |
3366 | 641 return ret; |
642 } | |
643 | |
644 GtkWidget *chat_page() { | |
645 GtkWidget *ret; | |
646 GtkWidget *vbox; | |
3427 | 647 GtkWidget *dd; |
648 GtkSizeGroup *sg; | |
3366 | 649 |
3427 | 650 ret = gtk_vbox_new(FALSE, 18); |
651 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 652 |
3427 | 653 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
3366 | 654 |
3427 | 655 vbox = make_frame (ret, _("Window")); |
4114 | 656 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
657 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
658 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
659 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
3427 | 660 gtk_size_group_add_widget(sg, dd); |
661 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
3818 | 662 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
663 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
664 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size.entry_height, 25, 9999, sg); | |
665 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); | |
3366 | 666 |
3427 | 667 vbox = make_frame (ret, _("Tab Completion")); |
4045 | 668 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
669 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
3427 | 670 |
671 vbox = make_frame (ret, _("Display")); | |
3818 | 672 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
673 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
3427 | 674 |
675 gtk_widget_show_all(ret); | |
3366 | 676 return ret; |
677 } | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
678 |
3366 | 679 GtkWidget *tab_page() { |
680 GtkWidget *ret; | |
681 GtkWidget *vbox; | |
3427 | 682 GtkWidget *dd; |
4445 | 683 GtkWidget *button; |
3427 | 684 GtkSizeGroup *sg; |
685 ret = gtk_vbox_new(FALSE, 18); | |
686 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 687 |
3427 | 688 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 689 |
3427 | 690 vbox = make_frame (ret, _("IM Tabs")); |
4114 | 691 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
692 _("Top"), 0, | |
693 _("Bottom"), OPT_IM_BR_TAB, | |
694 _("Left"), OPT_IM_SIDE_TAB, | |
695 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
3427 | 696 gtk_size_group_add_widget(sg, dd); |
4045 | 697 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
3818 | 698 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); |
3366 | 699 |
3427 | 700 vbox = make_frame (ret, _("Chat Tabs")); |
4114 | 701 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
702 _("Top"), 0, | |
703 _("Bottom"), OPT_CHAT_BR_TAB, | |
704 _("Left"), OPT_CHAT_SIDE_TAB, | |
705 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
3427 | 706 gtk_size_group_add_widget(sg, dd); |
3818 | 707 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
3366 | 708 vbox); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
709 |
3427 | 710 vbox = make_frame (ret, _("Buddy List Tabs")); |
4114 | 711 dd = gaim_dropdown(vbox, _("Tab _placement:"), &blist_options, OPT_BLIST_BOTTOM_TAB, |
712 _("Top"), 0, | |
713 _("Bottom"), OPT_BLIST_BOTTOM_TAB, NULL); | |
3427 | 714 gtk_size_group_add_widget(sg, dd); |
3500 | 715 |
4445 | 716 vbox = make_frame (ret, _("Tab Options")); |
717 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); | |
4449 | 718 convo_options ^= OPT_CONVO_NO_X_ON_TAB; |
4445 | 719 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); |
720 | |
721 | |
3427 | 722 gtk_widget_show_all(ret); |
3366 | 723 return ret; |
724 } | |
725 | |
726 GtkWidget *proxy_page() { | |
727 GtkWidget *ret; | |
728 GtkWidget *vbox; | |
729 GtkWidget *entry; | |
730 GtkWidget *label; | |
731 GtkWidget *hbox; | |
732 GtkWidget *table; | |
733 | |
3427 | 734 ret = gtk_vbox_new(FALSE, 18); |
735 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 736 |
3427 | 737 vbox = make_frame (ret, _("Proxy Type")); |
4634 | 738 gaim_dropdown(vbox, _("Proxy _type:"), (int*)&global_proxy_info.proxytype, -1, |
4114 | 739 _("No proxy"), PROXY_NONE, |
3366 | 740 "SOCKS 4", PROXY_SOCKS4, |
741 "SOCKS 5", PROXY_SOCKS5, | |
742 "HTTP", PROXY_HTTP, NULL); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
743 |
2254 | 744 table = gtk_table_new(2, 2, FALSE); |
745 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
746 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
747 gtk_table_set_row_spacings(GTK_TABLE(table), 5); | |
748 | |
3427 | 749 vbox = make_frame(ret, _("Proxy Server")); |
750 prefs_proxy_frame = vbox; | |
2254 | 751 |
4634 | 752 if (global_proxy_info.proxytype == PROXY_NONE) |
3427 | 753 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
2254 | 754 |
755 table = gtk_table_new(2, 4, FALSE); | |
756 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
757 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
758 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
3427 | 759 gtk_container_add(GTK_CONTAINER(vbox), table); |
2254 | 760 |
761 | |
3427 | 762 label = gtk_label_new_with_mnemonic(_("_Host")); |
2254 | 763 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
764 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
|
765 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
766 entry = gtk_entry_new(); |
3427 | 767 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 768 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
769 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
770 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
4634 | 771 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyhost); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
772 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
773 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
774 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
775 |
3427 | 776 label = gtk_label_new_with_mnemonic(_("Port")); |
2254 | 777 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
778 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
|
779 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
780 entry = gtk_entry_new(); |
3427 | 781 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 782 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
783 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
784 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
2254 | 785 |
4634 | 786 if (global_proxy_info.proxyport) { |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
787 char buf[128]; |
4634 | 788 g_snprintf(buf, sizeof(buf), "%d", global_proxy_info.proxyport); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
789 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
790 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
791 |
3427 | 792 label = gtk_label_new_with_mnemonic(_("_User")); |
2254 | 793 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
794 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
|
795 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
796 entry = gtk_entry_new(); |
3427 | 797 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 798 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
799 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
800 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
4634 | 801 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyuser); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
802 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
803 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
804 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
805 |
3427 | 806 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
2254 | 807 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
808 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
|
809 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
810 entry = gtk_entry_new(); |
3427 | 811 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 812 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
|
813 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
814 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
815 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
4634 | 816 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxypass); |
3500 | 817 |
3427 | 818 gtk_widget_show_all(ret); |
3366 | 819 return ret; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
820 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
821 |
3821 | 822 #ifndef _WIN32 |
4428 | 823 static void manual_browser_set(GtkButton *button, GtkEntry *entry) { |
824 | |
825 const char *program = gtk_entry_get_text(entry); | |
826 if (!program_is_valid(program)) { | |
827 char *error = g_strdup_printf(_("The entered manual browser " | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
828 "'%s' is not valid. Hyperlinks will " |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
829 "not work."), program); |
4428 | 830 do_error_dialog(error, NULL, GAIM_WARNING); |
831 } | |
832 | |
833 g_strlcpy(web_command, program, sizeof(web_command)); | |
834 } | |
835 | |
836 static void manual_browser_reset(GtkButton *button, GtkEntry *entry) { | |
837 gtk_entry_set_text(entry, web_command); | |
3432 | 838 } |
839 | |
4428 | 840 static GList *get_available_browsers() |
841 { | |
842 struct browser { | |
843 char *name; | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
844 char *command; |
4428 | 845 int id; |
846 }; | |
847 | |
848 static struct browser possible_browsers[] = { | |
849 {N_("Konqueror"), "kfmclient", BROWSER_KONQ}, | |
850 {N_("Opera"), "opera", BROWSER_OPERA}, | |
851 {N_("Galeon"), "galeon", BROWSER_GALEON}, | |
852 {N_("Netscape"), "netscape", BROWSER_NETSCAPE}, | |
853 {N_("Mozilla"), "mozilla", BROWSER_MOZILLA}, | |
854 }; | |
855 static const int num_possible_browsers = 5; | |
856 | |
857 GList *browsers = NULL; | |
858 int i = 0; | |
859 | |
860 browsers = g_list_prepend(browsers, GINT_TO_POINTER(BROWSER_MANUAL)); | |
861 browsers = g_list_prepend(browsers, _("Manual")); | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
862 for (i = 0; i < num_possible_browsers; i++) { |
4428 | 863 if (program_is_valid(possible_browsers[i].command)) { |
864 browsers = g_list_prepend(browsers, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
865 GINT_TO_POINTER(possible_browsers[i].id)); |
4428 | 866 browsers = g_list_prepend(browsers, possible_browsers[i].name); |
867 } | |
868 } | |
869 | |
870 return browsers; | |
871 } | |
872 | |
3366 | 873 GtkWidget *browser_page() { |
874 GtkWidget *ret; | |
3821 | 875 GtkWidget *vbox; |
876 GtkWidget *hbox; | |
3366 | 877 GtkWidget *label; |
3427 | 878 GtkSizeGroup *sg; |
4428 | 879 GList *browsers = NULL; |
3427 | 880 |
881 ret = gtk_vbox_new(FALSE, 18); | |
882 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
883 | |
884 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
885 vbox = make_frame (ret, _("Browser Selection")); | |
4428 | 886 |
887 browsers = get_available_browsers(); | |
888 if (browsers != NULL) { | |
889 label = gaim_dropdown_from_list(vbox,_("_Browser"), &web_browser, -1, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
890 browsers); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
891 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
892 gtk_size_group_add_widget(sg, label); |
4428 | 893 } |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
894 |
3366 | 895 hbox = gtk_hbox_new(FALSE, 5); |
896 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
4295 | 897 label = gtk_label_new_with_mnemonic(_("_Manual: ")); |
3366 | 898 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 899 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
900 gtk_size_group_add_widget(sg, label); | |
3366 | 901 browser_entry = gtk_entry_new(); |
3427 | 902 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3818 | 903 if (web_browser != BROWSER_MANUAL) |
4428 | 904 gtk_widget_set_sensitive(hbox, FALSE); |
3366 | 905 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
|
906 |
3818 | 907 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
4428 | 908 g_signal_connect_swapped(GTK_OBJECT(browser_entry), "activate", |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
909 G_CALLBACK(manual_browser_set), NULL); |
4428 | 910 label = gtk_button_new_with_label(_("Set")); |
911 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
912 g_signal_connect(GTK_OBJECT(label), "clicked", | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
913 G_CALLBACK(manual_browser_set), browser_entry); |
4428 | 914 label = gtk_button_new_with_label(_("Reset")); |
915 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
916 g_signal_connect(GTK_OBJECT(label), "clicked", | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
917 G_CALLBACK(manual_browser_reset), browser_entry); |
4428 | 918 |
919 if (browsers != NULL) { | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
920 vbox = make_frame (ret, _("Browser Options")); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
921 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
4428 | 922 } |
4451
ce5b64fac95d
[gaim-migrate @ 4726]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4449
diff
changeset
|
923 |
3427 | 924 gtk_widget_show_all(ret); |
3366 | 925 return ret; |
3500 | 926 } |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
927 #endif /*_WIN32*/ |
3366 | 928 |
929 GtkWidget *logging_page() { | |
930 GtkWidget *ret; | |
931 GtkWidget *vbox; | |
3427 | 932 ret = gtk_vbox_new(FALSE, 18); |
933 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
934 |
3427 | 935 vbox = make_frame (ret, _("Message Logs")); |
4045 | 936 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
3818 | 937 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); |
938 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
|
939 |
3427 | 940 vbox = make_frame (ret, _("System Logs")); |
3818 | 941 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
3366 | 942 vbox); |
3818 | 943 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
3366 | 944 vbox); |
3818 | 945 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
946 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
3366 | 947 vbox); |
3818 | 948 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
3366 | 949 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
950 |
3427 | 951 gtk_widget_show_all(ret); |
3366 | 952 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
953 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
954 |
3366 | 955 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
956 |
3821 | 957 #ifndef _WIN32 |
4095 | 958 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
959 { |
4561 | 960 gaim_sound_set_command(gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
3366 | 961 return TRUE; |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
962 } |
3821 | 963 #endif |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
964 |
3366 | 965 GtkWidget *sound_page() { |
966 GtkWidget *ret; | |
3821 | 967 GtkWidget *vbox; |
968 GtkSizeGroup *sg; | |
969 #ifndef _WIN32 | |
970 GtkWidget *dd; | |
971 GtkWidget *hbox; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
972 GtkWidget *label; |
4561 | 973 char *cmd; |
3821 | 974 #endif |
3366 | 975 |
3427 | 976 ret = gtk_vbox_new(FALSE, 18); |
977 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
978 |
3427 | 979 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
980 |
3427 | 981 vbox = make_frame (ret, _("Sound Options")); |
3818 | 982 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
983 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
|
984 |
3630 | 985 #ifndef _WIN32 |
3427 | 986 vbox = make_frame (ret, _("Sound Method")); |
4114 | 987 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
4581 | 988 OPT_SOUND_ESD | OPT_SOUND_ARTS | OPT_SOUND_NAS | |
989 OPT_SOUND_NORMAL | OPT_SOUND_CMD, | |
4114 | 990 _("Console beep"), OPT_SOUND_BEEP, |
4561 | 991 #ifdef USE_AO |
992 _("Automatic"), OPT_SOUND_NORMAL, | |
4581 | 993 "ESD", OPT_SOUND_ESD, |
994 "Arts", OPT_SOUND_ARTS, | |
995 #endif | |
996 #ifdef USE_NAS_AUDIO | |
997 "NAS", OPT_SOUND_NAS, | |
4082 | 998 #endif |
4114 | 999 _("Command"), OPT_SOUND_CMD, NULL); |
3427 | 1000 gtk_size_group_add_widget(sg, dd); |
1001 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1002 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1003 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1004 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 1005 |
3366 | 1006 hbox = gtk_hbox_new(FALSE, 5); |
1007 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 1008 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 1009 gtk_size_group_add_widget(sg, label); |
1010 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1011 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
|
1012 |
3366 | 1013 sndcmd = gtk_entry_new(); |
3427 | 1014 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1015 |
3366 | 1016 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE); |
4561 | 1017 cmd = gaim_sound_get_command(); |
1018 if(cmd) | |
1019 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); | |
3366 | 1020 gtk_widget_set_size_request(sndcmd, 75, -1); |
3427 | 1021 |
3818 | 1022 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
3366 | 1023 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1024 g_signal_connect(GTK_OBJECT(sndcmd), "changed", G_CALLBACK(sound_cmd_yeah), NULL); |
3630 | 1025 #endif /* _WIN32 */ |
3427 | 1026 gtk_widget_show_all(ret); |
3366 | 1027 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1028 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1029 |
3366 | 1030 GtkWidget *away_page() { |
1031 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1032 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1033 GtkWidget *hbox; |
3366 | 1034 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1035 GtkWidget *button; |
3366 | 1036 GtkWidget *select; |
3427 | 1037 GtkWidget *dd; |
1038 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1039 |
3427 | 1040 ret = gtk_vbox_new(FALSE, 18); |
1041 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1042 |
3427 | 1043 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1044 |
3427 | 1045 vbox = make_frame (ret, _("Away")); |
3818 | 1046 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
1047 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
1048 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
|
1049 |
3427 | 1050 vbox = make_frame (ret, _("Auto-response")); |
3366 | 1051 hbox = gtk_hbox_new(FALSE, 0); |
1052 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 1053 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
3818 | 1054 &away_resend, 1, 24 * 60 * 60, sg); |
1055 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
1056 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
1057 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
|
1058 |
3818 | 1059 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
3366 | 1060 gtk_widget_set_sensitive(hbox, FALSE); |
3500 | 1061 |
3427 | 1062 vbox = make_frame (ret, _("Idle")); |
4052 | 1063 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
1064 _("None"), IDLE_NONE, | |
1065 _("Gaim usage"), IDLE_GAIM, | |
3366 | 1066 #ifdef USE_SCREENSAVER |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1067 #ifndef _WIN32 |
4052 | 1068 _("X usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1069 #else |
4052 | 1070 _("Windows usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1071 #endif |
3366 | 1072 #endif |
3427 | 1073 NULL); |
1074 gtk_size_group_add_widget(sg, dd); | |
1075 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1076 |
3427 | 1077 vbox = make_frame (ret, _("Auto-away")); |
3818 | 1078 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
4052 | 1079 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
3818 | 1080 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1081 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1082 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1083 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
1 | 1084 |
4052 | 1085 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
3427 | 1086 gtk_size_group_add_widget(sg, label); |
1087 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1088 hbox = gtk_hbox_new(FALSE, 0); |
1089 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1090 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1091 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 1092 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3818 | 1093 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1094 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1095 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1096 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); |
3366 | 1097 default_away_menu_init(prefs_away_menu); |
1098 gtk_widget_show(prefs_away_menu); | |
1099 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
3500 | 1100 |
3427 | 1101 gtk_widget_show_all(ret); |
3366 | 1102 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1103 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1104 |
3551 | 1105 #if USE_PLUGINS |
1106 GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
1107 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
1108 { | |
1109 gchar buf[1024]; | |
1110 GtkTreeIter iter; | |
1111 GValue val = { 0, }; | |
1112 struct gaim_plugin *plug; | |
1113 | |
1114 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1115 return; | |
1116 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1117 plug = g_value_get_pointer(&val); | |
1118 | |
3563 | 1119 if (plug->error[0]) |
4309 | 1120 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
3563 | 1121 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
4309 | 1122 "%s", plug->desc.name, plug->desc.version, plug->error, plug->desc.description); |
3563 | 1123 else |
4309 | 1124 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
1125 "%s", plug->desc.name, plug->desc.version, plug->desc.description); | |
3551 | 1126 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3630 | 1127 g_snprintf(buf, sizeof(buf), |
1128 #ifndef _WIN32 | |
1129 _("<span size=\"larger\">%s %s</span>\n\n" | |
1130 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
4617 | 1131 "<span weight=\"bold\">Web site:</span>\t\t%s\n" |
3630 | 1132 "<span weight=\"bold\">File name:</span>\t%s"), |
1133 #else | |
1134 _("<span size=\"larger\">%s %s</span>\n\n" | |
1135 "<span weight=\"bold\">Written by:</span> %s\n" | |
1136 "<span weight=\"bold\">URL:</span> %s\n" | |
1137 "<span weight=\"bold\">File name:</span> %s"), | |
1138 #endif | |
3551 | 1139 plug->desc.name, plug->desc.version, plug->desc.authors, plug->desc.url, plug->path); |
1140 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
1141 g_value_unset (&val); | |
1142 } | |
1143 | |
1144 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1145 { | |
1146 GtkTreeModel *model = (GtkTreeModel *)data; | |
1147 GtkTreeIter iter; | |
1148 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1149 struct gaim_plugin *plug; | |
1150 gchar buf[1024]; | |
3565 | 1151 GtkWidget *(*config)(); |
1152 | |
3551 | 1153 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1154 gdk_window_set_cursor(prefs->window, wait); | |
1155 gdk_cursor_unref(wait); | |
1156 | |
1157 gtk_tree_model_get_iter (model, &iter, path); | |
1158 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
1159 | |
1160 if (!plug->handle) | |
1161 | |
1162 if (plug->type == plugin) | |
1163 #ifdef GAIM_PLUGINS | |
3565 | 1164 { |
1165 load_plugin(plug->path); | |
1166 if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
1167 plug->iter = g_new0(GtkTreeIter, 1); | |
1168 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
3567 | 1169 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), &plugin_iter) == 1) { |
1170 /* Expand the tree for the first plugin added */ | |
3630 | 1171 GtkTreePath *path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), &plugin_iter); |
3567 | 1172 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), path2, TRUE); |
1173 gtk_tree_path_free (path2); | |
1174 } | |
3565 | 1175 } |
1176 } | |
3551 | 1177 #else |
1178 {} | |
1179 #endif | |
1180 else | |
1181 #ifdef USE_PERL | |
1182 perl_load_file(plug->path); | |
1183 #else | |
1184 {} | |
1185 #endif | |
1186 else | |
1187 if (plug->type == plugin) | |
1188 #ifdef GAIM_PLUGINS | |
3565 | 1189 { |
1190 unload_plugin(plug); | |
1191 if (plug->iter) { | |
1192 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter); | |
1193 g_free(plug->iter); | |
1194 plug->iter = NULL; | |
1195 } | |
1196 } | |
3551 | 1197 #else |
1198 {} | |
1199 #endif | |
1200 else | |
1201 #ifdef USE_PERL | |
1202 perl_unload_file(plug); | |
1203 #else | |
1204 {} | |
1205 #endif | |
1206 gdk_window_set_cursor(prefs->window, NULL); | |
3563 | 1207 if (plug->error[0]) |
4309 | 1208 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
3563 | 1209 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
4309 | 1210 "%s", plug->desc.name, plug->desc.version, plug->error, plug->desc.description); |
3563 | 1211 else |
4309 | 1212 g_snprintf(buf, sizeof(buf), "<span size=\"larger\">%s %s</span>\n\n" |
1213 "%s", plug->desc.name, plug->desc.version, plug->desc.description); | |
3563 | 1214 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3551 | 1215 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, plug->handle, -1); |
3563 | 1216 |
3551 | 1217 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1218 gtk_tree_path_free(path); | |
1219 } | |
1220 | |
1221 static GtkWidget *plugin_page () | |
1222 { | |
1223 GtkWidget *ret; | |
1224 | |
1225 GtkWidget *sw, *vp; | |
1226 GtkTreeIter iter; | |
1227 GtkWidget *event_view; | |
1228 GtkListStore *ls; | |
1229 GtkCellRenderer *rend, *rendt; | |
1230 GtkTreeViewColumn *col; | |
1231 GtkTreeSelection *sel; | |
1232 GtkTreePath *path; | |
1233 | |
1234 GtkWidget *nb; | |
1235 | |
1236 GList *probes = probed_plugins; | |
1237 struct gaim_plugin *plug; | |
1238 | |
1239 ret = gtk_vbox_new(FALSE, 18); | |
1240 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1241 | |
1242 sw = gtk_scrolled_window_new(NULL,NULL); | |
1243 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1244 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1245 | |
1246 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1247 | |
1248 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
1249 while (probes) { | |
1250 plug = probes->data; | |
1251 gtk_list_store_append (ls, &iter); | |
1252 gtk_list_store_set(ls, &iter, | |
1253 0, plug->handle, | |
1254 1, plug->desc.name ? plug->desc.name : plug->path, | |
1255 2, plug, -1); | |
1256 probes = probes->next; | |
1257 } | |
1258 | |
1259 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
1260 | |
1261 rend = gtk_cell_renderer_toggle_new(); | |
1262 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1263 | |
1264 | |
4295 | 1265 col = gtk_tree_view_column_new_with_attributes (_("Load"), |
3551 | 1266 rend, |
1267 "active", 0, | |
1268 NULL); | |
1269 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1270 | |
1271 rendt = gtk_cell_renderer_text_new(); | |
4295 | 1272 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
3551 | 1273 rendt, |
1274 "text", 1, | |
1275 NULL); | |
1276 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1277 g_object_unref(G_OBJECT(ls)); | |
1278 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1279 | |
1280 | |
1281 nb = gtk_notebook_new(); | |
1282 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1283 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1284 | |
1285 /* Description */ | |
1286 sw = gtk_scrolled_window_new(NULL, NULL); | |
1287 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1288 plugin_description = gtk_label_new(NULL); | |
1289 | |
1290 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1291 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1292 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1293 | |
3630 | 1294 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
1295 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1296 |
3630 | 1297 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
1298 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
3551 | 1299 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
1300 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1301 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1302 | |
1303 /* Details */ | |
1304 sw = gtk_scrolled_window_new(NULL, NULL); | |
1305 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1306 plugin_details = gtk_label_new(NULL); | |
1307 | |
1308 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1309 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1310 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1311 | |
3630 | 1312 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
1313 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1314 |
3630 | 1315 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
1316 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
3551 | 1317 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
1318 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1319 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1320 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1321 | |
1322 g_signal_connect (G_OBJECT (sel), "changed", | |
1323 G_CALLBACK (prefs_plugin_sel), | |
1324 NULL); | |
1325 g_signal_connect (G_OBJECT(rend), "toggled", | |
1326 G_CALLBACK(plugin_load), ls); | |
1327 | |
1328 path = gtk_tree_path_new_first(); | |
1329 gtk_tree_selection_select_path(sel, path); | |
1330 gtk_tree_path_free(path); | |
1331 | |
1332 gtk_widget_show_all(ret); | |
1333 return ret; | |
1334 } | |
1335 #endif | |
1336 | |
3366 | 1337 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1338 { |
3366 | 1339 GtkTreeModel *model = (GtkTreeModel *)data; |
1340 GtkTreeIter iter; | |
1341 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
3500 | 1342 gint soundnum; |
3366 | 1343 |
1344 gtk_tree_model_get_iter (model, &iter, path); | |
1345 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1346 |
4561 | 1347 sound_options ^= gaim_sound_get_event_option(soundnum); |
1348 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & gaim_sound_get_event_option(soundnum), -1); | |
3522 | 1349 |
1350 gtk_tree_path_free(path); | |
3366 | 1351 } |
1352 | |
1353 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1354 { | |
1355 guint32 tmp_sound = sound_options; | |
1356 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
1357 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
4561 | 1358 if (!(sound_options & gaim_sound_get_event_option(sound_row_sel))) |
1359 sound_options ^= gaim_sound_get_event_option(sound_row_sel); | |
1360 gaim_sound_play_event(sound_row_sel); | |
3500 | 1361 |
3366 | 1362 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1363 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1364 |
3366 | 1365 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
|
1366 { |
3366 | 1367 /* This just resets a sound file back to default */ |
4561 | 1368 gaim_sound_set_event_file(sound_row_sel, NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1369 |
3366 | 1370 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1371 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1372 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1373 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 1374 { |
1375 | |
1376 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1377 |
1170 | 1378 if (!GTK_IS_WIDGET(w2)) |
1379 dest = w; | |
1380 else | |
1381 dest = w2; | |
1382 | |
1383 sounddialog = NULL; | |
1384 | |
1385 gtk_widget_destroy(dest); | |
1386 } | |
1387 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1388 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1389 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1390 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1391 |
1170 | 1392 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
1393 | |
1394 /* If they type in a directory, change there */ | |
1395 if (file_is_dir(file, sounddialog)) | |
1396 return; | |
1397 | |
1398 /* Set it -- and forget it */ | |
4561 | 1399 gaim_sound_set_event_file(snd, file); |
3500 | 1400 |
1175 | 1401 /* Set our text entry */ |
4561 | 1402 gtk_entry_set_text(GTK_ENTRY(sound_entry), file); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1403 |
1170 | 1404 /* Close the window! It's getting cold in here! */ |
1405 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1406 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1407 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1408 g_free(last_sound_dir); |
4561 | 1409 last_sound_dir = g_dirname(file); |
1170 | 1410 } |
1411 | |
3366 | 1412 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
|
1413 { |
1170 | 1414 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1415 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1416 if (!sounddialog) { |
1170 | 1417 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration")); |
1418 | |
1419 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1420 | |
3630 | 1421 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
1170 | 1422 |
1423 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1424 | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1425 g_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1426 G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1427 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1428 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1429 "clicked", G_CALLBACK(do_select_sound), (int *)sound_row_sel); |
1170 | 1430 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1431 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1432 "clicked", G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1433 } |
1434 | |
1435 g_free(buf); | |
1436 gtk_widget_show(sounddialog); | |
1437 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1438 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1439 |
3366 | 1440 |
1441 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1442 GtkTreeIter iter; | |
1443 GValue val = { 0, }; | |
4561 | 1444 char *file; |
3500 | 1445 |
3366 | 1446 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1447 return; | |
1448 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1449 sound_row_sel = g_value_get_uint(&val); | |
4561 | 1450 file = gaim_sound_get_event_file(sound_row_sel); |
3366 | 1451 if (sound_entry) |
4561 | 1452 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); |
3366 | 1453 g_value_unset (&val); |
1454 if (sounddialog) | |
1455 gtk_widget_destroy(sounddialog); | |
1456 } | |
1457 | |
1458 GtkWidget *sound_events_page() { | |
1459 | |
1460 GtkWidget *ret; | |
1461 GtkWidget *sw; | |
1462 GtkWidget *button, *hbox; | |
1463 GtkTreeIter iter; | |
1464 GtkWidget *event_view; | |
1465 GtkListStore *event_store; | |
1466 GtkCellRenderer *rend; | |
1467 GtkTreeViewColumn *col; | |
1468 GtkTreeSelection *sel; | |
1469 GtkTreePath *path; | |
1470 int j; | |
4561 | 1471 char *file; |
3366 | 1472 |
3427 | 1473 ret = gtk_vbox_new(FALSE, 18); |
1474 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 1475 |
1476 sw = gtk_scrolled_window_new(NULL,NULL); | |
1477 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3814 | 1478 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1479 | |
3427 | 1480 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1481 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
1482 | |
4561 | 1483 for (j=0; j < GAIM_NUM_SOUNDS; j++) { |
1484 guint opt = gaim_sound_get_event_option(j); | |
1485 if (opt == 0) | |
3366 | 1486 continue; |
3500 | 1487 |
3366 | 1488 gtk_list_store_append (event_store, &iter); |
1489 gtk_list_store_set(event_store, &iter, | |
4561 | 1490 0, sound_options & opt, |
1491 1, gettext(gaim_sound_get_event_label(j)), | |
3366 | 1492 2, j, -1); |
1493 } | |
1494 | |
1495 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
3500 | 1496 |
3366 | 1497 rend = gtk_cell_renderer_toggle_new(); |
1498 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1499 g_signal_connect (G_OBJECT (sel), "changed", | |
1500 G_CALLBACK (prefs_sound_sel), | |
1501 NULL); | |
1502 g_signal_connect (G_OBJECT(rend), "toggled", | |
1503 G_CALLBACK(event_toggled), event_store); | |
1504 path = gtk_tree_path_new_first(); | |
1505 gtk_tree_selection_select_path(sel, path); | |
3522 | 1506 gtk_tree_path_free(path); |
3500 | 1507 |
4295 | 1508 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
3366 | 1509 rend, |
1510 "active", 0, | |
1511 NULL); | |
1512 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1513 | |
1514 rend = gtk_cell_renderer_text_new(); | |
4295 | 1515 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
3366 | 1516 rend, |
1517 "text", 1, | |
1518 NULL); | |
1519 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
3500 | 1520 g_object_unref(G_OBJECT(event_store)); |
3366 | 1521 gtk_container_add(GTK_CONTAINER(sw), event_view); |
1522 | |
3427 | 1523 hbox = gtk_hbox_new(FALSE, 6); |
1524 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1525 sound_entry = gtk_entry_new(); |
4561 | 1526 file = gaim_sound_get_event_file(0); |
1527 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); | |
3366 | 1528 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE); |
1529 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
|
1530 |
3025 | 1531 button = gtk_button_new_with_label(_("Test")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1532 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
3366 | 1533 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
|
1534 |
1175 | 1535 button = gtk_button_new_with_label(_("Reset")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1536 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
3366 | 1537 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
1175 | 1538 |
1381 | 1539 button = gtk_button_new_with_label(_("Choose...")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1540 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); |
3366 | 1541 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
3500 | 1542 |
3427 | 1543 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1544 |
3366 | 1545 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1546 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1547 |
3366 | 1548 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1549 { |
3366 | 1550 GtkTreeIter iter; |
1551 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1552 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1553 char *tmp; |
3374 | 1554 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1555 |
3366 | 1556 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1557 return; | |
1558 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1559 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1560 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1561 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1562 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1563 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
|
1564 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1565 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
|
1566 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1567 g_free(tmp); |
3366 | 1568 g_value_unset (&val); |
3500 | 1569 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1570 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1571 |
3500 | 1572 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
3366 | 1573 struct away_message *am; |
1574 GtkTreeIter iter; | |
1575 GtkTreePath *path; | |
1576 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv)); | |
1577 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1578 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1579 GValue val = { 0, }; |
3500 | 1580 |
3379 | 1581 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1582 return; |
3379 | 1583 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1584 am = g_value_get_pointer (&val); |
1585 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1586 rem_away_mess(NULL, am); | |
3379 | 1587 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter); |
1588 path = gtk_tree_path_new_first(); | |
3366 | 1589 gtk_tree_selection_select_path(sel, path); |
3522 | 1590 gtk_tree_path_free(path); |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1591 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1592 |
3366 | 1593 GtkWidget *away_message_page() { |
1594 GtkWidget *ret; | |
3427 | 1595 GtkWidget *hbox; |
3379 | 1596 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1597 GtkWidget *sw; |
3366 | 1598 GtkTreeIter iter; |
1599 GtkWidget *event_view; | |
1600 GtkCellRenderer *rend; | |
1601 GtkTreeViewColumn *col; | |
1602 GtkTreeSelection *sel; | |
940 | 1603 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1604 struct away_message *a; |
3366 | 1605 GtkWidget *sw2; |
3427 | 1606 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1607 |
3427 | 1608 ret = gtk_vbox_new(FALSE, 18); |
1609 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1610 | |
1611 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
3500 | 1612 |
3366 | 1613 sw = gtk_scrolled_window_new(NULL,NULL); |
1614 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1615 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3817 | 1616 /* |
1617 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1618 */ | |
3427 | 1619 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3500 | 1620 |
3374 | 1621 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1622 while (awy) { |
1623 a = (struct away_message *)awy->data; | |
1624 gtk_list_store_append (prefs_away_store, &iter); | |
1625 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1626 0, a->name, |
1627 1, a, -1); | |
3366 | 1628 awy = awy->next; |
1629 } | |
1630 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
|
1631 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1632 |
3366 | 1633 rend = gtk_cell_renderer_text_new(); |
1634 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1635 rend, | |
1636 "text", 0, | |
1637 NULL); | |
1638 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1639 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1640 gtk_widget_show(event_view); | |
3427 | 1641 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1642 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1643 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1644 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1645 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1646 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3500 | 1647 |
3427 | 1648 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
|
1649 gaim_setup_imhtml(away_text); |
3366 | 1650 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
1651 g_signal_connect (G_OBJECT (sel), "changed", | |
1652 G_CALLBACK (away_message_sel), | |
1653 NULL); | |
1654 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1655 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1656 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1657 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1658 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1659 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), NULL); |
3472 | 1660 |
3366 | 1661 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1662 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1663 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(remove_away_message), event_view); |
3472 | 1664 |
3366 | 1665 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1666 |
3649 | 1667 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL); |
3427 | 1668 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1669 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), event_view); |
3366 | 1670 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1671 |
3427 | 1672 gtk_widget_show_all(ret); |
3366 | 1673 return ret; |
1674 } | |
3472 | 1675 |
3500 | 1676 GtkTreeIter *prefs_notebook_add_page(char *text, |
1677 GdkPixbuf *pixbuf, | |
1678 GtkWidget *page, | |
3366 | 1679 GtkTreeIter *iter, |
3500 | 1680 GtkTreeIter *parent, |
3366 | 1681 int ind) { |
1682 GdkPixbuf *icon = NULL; | |
3500 | 1683 |
3366 | 1684 if (pixbuf) |
3500 | 1685 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
|
1686 |
3366 | 1687 gtk_tree_store_append (prefstree, iter, parent); |
1688 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1689 |
3366 | 1690 if (pixbuf) |
1691 g_object_unref(pixbuf); | |
1692 if (icon) | |
1693 g_object_unref(icon); | |
1694 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1695 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1696 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1697 |
3366 | 1698 void prefs_notebook_init() { |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1699 GtkTreeIter p, p2, c; |
3565 | 1700 #if USE_PLUGINS |
1701 GtkWidget *(*config)(); | |
1702 GList *l = plugins; | |
1703 struct gaim_plugin *plug; | |
1704 #endif | |
1705 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
4620 | 1706 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); |
3565 | 1707 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
1708 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1709 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1710 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
4488 | 1711 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1712 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1713 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1714 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p2, notebook_page++); |
3565 | 1715 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1716 #ifndef _WIN32 |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1717 /* We use the registered default browser in windows */ |
3565 | 1718 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1719 #endif |
3565 | 1720 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
1721 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1722 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1723 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1724 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
3551 | 1725 #if USE_PLUGINS |
3565 | 1726 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
1727 while (l) { | |
1728 plug = l->data; | |
1729 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) { | |
1730 plug->iter = g_new0(GtkTreeIter, 1); | |
1731 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++); | |
1732 } | |
1733 l = l->next; | |
1734 } | |
3551 | 1735 #endif |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1736 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1737 |
3500 | 1738 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1739 { |
3366 | 1740 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1741 GtkWidget *hbox; |
3366 | 1742 GtkWidget *frame; |
1743 GtkTreeViewColumn *column; | |
1744 GtkCellRenderer *cell; | |
1745 GtkTreeSelection *sel; | |
1746 GtkWidget *notebook; | |
1747 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1748 GtkWidget *button; |
3515 | 1749 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
3500 | 1750 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1751 if (prefs) { |
3472 | 1752 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1753 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1754 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1755 |
3366 | 1756 /* copy the preferences to tmp values... |
1757 * I liked "take affect immediately" Oh well :-( */ | |
3818 | 1758 |
1759 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
3500 | 1760 |
3366 | 1761 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1762 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4074 | 1763 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1764 gtk_widget_realize(prefs); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1765 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences")); |
3366 | 1766 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1767 g_signal_connect(GTK_OBJECT(prefs), "destroy", G_CALLBACK(delete_prefs), NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1768 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1769 vbox = gtk_vbox_new(FALSE, 5); |
1185 | 1770 gtk_container_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1771 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1772 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1773 |
3366 | 1774 hbox = gtk_hbox_new (FALSE, 6); |
1775 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1776 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1777 gtk_widget_show (hbox); | |
1778 | |
1779 frame = gtk_frame_new (NULL); | |
1780 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1781 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1782 gtk_widget_show (frame); | |
3500 | 1783 |
3366 | 1784 /* The tree -- much inspired by the Gimp */ |
1785 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1786 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1787 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1788 | |
1789 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1790 gtk_widget_show(tree_v); | |
1791 /* icons */ | |
1792 cell = gtk_cell_renderer_pixbuf_new (); | |
1793 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
3500 | 1794 |
3366 | 1795 /* text */ |
1796 cell = gtk_cell_renderer_text_new (); | |
1797 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1798 |
3366 | 1799 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
|
1800 |
3472 | 1801 /* The right side */ |
1802 frame = gtk_frame_new (NULL); | |
1803 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1804 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1805 gtk_widget_show (frame); | |
3500 | 1806 |
3472 | 1807 vbox2 = gtk_vbox_new (FALSE, 4); |
1808 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1809 gtk_widget_show (vbox2); | |
3500 | 1810 |
3472 | 1811 frame = gtk_frame_new (NULL); |
1812 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1813 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1814 gtk_widget_show (frame); | |
3500 | 1815 |
3472 | 1816 hbox = gtk_hbox_new (FALSE, 4); |
1817 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1818 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1819 gtk_widget_show (hbox); | |
3500 | 1820 |
3472 | 1821 preflabel = gtk_label_new(NULL); |
1822 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1823 gtk_widget_show (preflabel); | |
3500 | 1824 |
3472 | 1825 /* The notebook */ |
1826 prefsnotebook = notebook = gtk_notebook_new (); | |
1827 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1828 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1829 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
|
1830 |
3472 | 1831 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1832 g_signal_connect (G_OBJECT (sel), "changed", | |
1833 G_CALLBACK (pref_nb_select), | |
1834 notebook); | |
3500 | 1835 gtk_widget_show(notebook); |
3472 | 1836 sep = gtk_hseparator_new(); |
1837 gtk_widget_show(sep); | |
1838 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1839 |
3818 | 1840 /* The buttons^H to press! */ |
3472 | 1841 hbox = gtk_hbox_new (FALSE, 6); |
1842 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1843 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1844 gtk_widget_show (hbox); |
3377 | 1845 |
3818 | 1846 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
3515 | 1847 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1848 g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_destroy), prefs); |
3515 | 1849 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1850 gtk_widget_show(button); | |
1851 | |
3500 | 1852 prefs_notebook_init(); |
3427 | 1853 |
3472 | 1854 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1855 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1856 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1857 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1858 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1859 { |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1860 if (debugbutton) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1861 gtk_button_clicked(GTK_BUTTON(debugbutton)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1862 if (misc_options & OPT_MISC_DEBUG) { |
3818 | 1863 misc_options ^= OPT_MISC_DEBUG; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1864 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1865 g_free(dw); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1866 dw = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1867 return FALSE; |
1 | 1868 |
1869 } | |
1870 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1871 static void build_debug() |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1872 { |
4005 | 1873 GtkWidget *sw; |
1874 GtkTextBuffer *buffer; | |
1875 GtkTextIter end; | |
1876 | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1877 if (!dw) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1878 dw = g_new0(struct debug_window, 1); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1879 |
2725
f3c094e78609
[gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2676
diff
changeset
|
1880 GAIM_DIALOG(dw->window); |
4005 | 1881 gtk_window_set_default_size(GTK_WINDOW(dw->window), 500, 200); |
1882 gtk_window_set_role(GTK_WINDOW(dw->window), "debug"); | |
1883 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim - Debug Window")); | |
1884 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
|
1885 |
4005 | 1886 sw = gtk_scrolled_window_new(NULL, NULL); |
1887 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
1888 GTK_POLICY_NEVER, | |
1889 GTK_POLICY_ALWAYS); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1890 |
4005 | 1891 dw->entry = gtk_text_view_new(); |
1892 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1893 gtk_text_view_set_editable(GTK_TEXT_VIEW(dw->entry), FALSE); | |
1894 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
|
1895 |
4005 | 1896 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1897 gtk_text_buffer_get_end_iter(buffer, &end); | |
1898 gtk_text_buffer_create_mark(buffer, "end", &end, FALSE); | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1899 |
4005 | 1900 gtk_container_add(GTK_CONTAINER(sw), dw->entry); |
1901 gtk_container_add(GTK_CONTAINER(dw->window), sw); | |
1902 gtk_widget_show_all(dw->window); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1903 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1904 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1905 void show_debug() |
1 | 1906 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1907 if ((misc_options & OPT_MISC_DEBUG)) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1908 if (!dw || !dw->window) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1909 build_debug(); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1910 gtk_widget_show(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1911 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1912 if (!dw) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1913 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1914 gtk_widget_destroy(dw->window); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1915 dw->window = NULL; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1916 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1917 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1918 |
970 | 1919 void debug_printf(char *fmt, ...) |
1920 { | |
1921 va_list ap; | |
1922 gchar *s; | |
1923 | |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1924 va_start(ap, fmt); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1925 s = g_strdup_vprintf(fmt, ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1926 va_end(ap); |
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1927 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1928 if (misc_options & OPT_MISC_DEBUG && dw) { |
4005 | 1929 GtkTextBuffer *buffer; |
1930 GtkTextMark *endmark; | |
1931 GtkTextIter end; | |
2282
0dea5214d63f
[gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2269
diff
changeset
|
1932 |
4005 | 1933 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(dw->entry)); |
1934 endmark = gtk_text_buffer_get_mark(buffer, "end"); | |
1935 gtk_text_buffer_get_iter_at_mark(buffer, &end, endmark); | |
1936 gtk_text_buffer_insert(buffer, &end, s, -1); | |
1937 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
|
1938 } |
2823
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1939 if (opt_debug) |
cd23279122ed
[gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2794
diff
changeset
|
1940 g_print("%s", s); |
1366
155db3303ebb
[gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1357
diff
changeset
|
1941 g_free(s); |
970 | 1942 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1943 |
1 | 1944 void set_option(GtkWidget *w, int *option) |
1945 { | |
1946 *option = !(*option); | |
1947 } | |
1948 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1949 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1950 { |
3818 | 1951 misc_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1952 |
3818 | 1953 if (option == OPT_MISC_DEBUG) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1954 show_debug(); |
4227 | 1955 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
1956 redo_buddy_list(); | |
1957 build_edit_tree(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1958 gaim_conversation_foreach(gaim_conversation_autoset_title); |
4227 | 1959 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1960 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1961 |
3818 | 1962 static void set_logging_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1963 { |
3818 | 1964 logging_options ^= option; |
3500 | 1965 |
3818 | 1966 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
1967 update_log_convs(); | |
3366 | 1968 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1969 |
3818 | 1970 static void set_blist_option(GtkWidget *w, int option) |
3366 | 1971 { |
3818 | 1972 blist_options ^= option; |
3500 | 1973 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1974 if (!blist) |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1975 return; |
3500 | 1976 |
3818 | 1977 if (option == OPT_BLIST_NO_BUTTONS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1978 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS)); |
696
97b75ed155b0
[gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
683
diff
changeset
|
1979 |
3818 | 1980 if (option == OPT_BLIST_SHOW_GRPNUM) |
1070
b288f17c2fb2
[gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
1981 update_num_groups(); |
9 | 1982 |
3818 | 1983 if (option == OPT_BLIST_NO_MT_GRP) |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1984 toggle_show_empty_groups(); |
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1070
diff
changeset
|
1985 |
3818 | 1986 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
|
1987 update_button_pix(); |
11e5b1220028
[gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1269
diff
changeset
|
1988 |
3818 | 1989 if (option == OPT_BLIST_SHOW_PIXMAPS) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1990 toggle_buddy_pixmaps(); |
2593
5ba9ef368b8e
[gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2592
diff
changeset
|
1991 |
3818 | 1992 if ((option == OPT_BLIST_GREY_IDLERS) || (option == OPT_BLIST_SHOW_IDLETIME)) |
2594 | 1993 update_idle_times(); |
3032 | 1994 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1995 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1996 |
3818 | 1997 static void set_convo_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1998 { |
3818 | 1999 convo_options ^= option; |
3500 | 2000 |
3818 | 2001 if (option == OPT_CONVO_SHOW_SMILEY) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2002 gaim_gtkconv_toggle_smileys(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2003 |
3818 | 2004 if (option == OPT_CONVO_SHOW_TIME) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2005 gaim_gtkconv_toggle_timestamps(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2006 |
3818 | 2007 if (option == OPT_CONVO_CHECK_SPELLING) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2008 gaim_gtkconv_toggle_spellchk(); |
4445 | 2009 |
2010 if (option == OPT_CONVO_NO_X_ON_TAB) | |
2011 gaim_gtkconv_toggle_close_buttons(); | |
3818 | 2012 } |
2013 | |
2014 static void set_im_option(GtkWidget *w, int option) | |
2015 { | |
2016 im_options ^= option; | |
3500 | 2017 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2018 #if 0 |
3818 | 2019 if (option == OPT_IM_ONE_WINDOW) |
2020 im_tabize(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2021 #endif |
3818 | 2022 |
2023 if (option == OPT_IM_HIDE_ICONS) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2024 gaim_gtkconv_hide_buddy_icons(); |
3818 | 2025 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2026 if (option == OPT_IM_ALIAS_TAB) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2027 gaim_conversation_foreach(gaim_conversation_autoset_title); |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2028 |
3818 | 2029 if (option == OPT_IM_NO_ANIMATION) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2030 gaim_gtkconv_set_anim(); |
1 | 2031 } |
2032 | |
3818 | 2033 static void set_chat_option(GtkWidget *w, int option) |
1 | 2034 { |
3818 | 2035 chat_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2036 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2037 #if 0 |
3818 | 2038 if (option == OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2039 chat_tabize(); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2040 #endif |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2041 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2042 |
3818 | 2043 void set_sound_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2044 { |
3818 | 2045 sound_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2046 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2047 |
3818 | 2048 static void set_font_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2049 { |
3818 | 2050 font_options ^= option; |
3500 | 2051 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2052 gaim_gtkconv_update_font_buttons(); |
1 | 2053 } |
2054 | |
3818 | 2055 static void set_away_option(GtkWidget *w, int option) |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2056 { |
3818 | 2057 away_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2058 |
3818 | 2059 if (option == OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2060 toggle_away_queue(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2061 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2062 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2063 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 2064 { |
2065 GtkWidget *button; | |
3427 | 2066 button = gtk_check_button_new_with_mnemonic(text); |
1 | 2067 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option)); |
2068 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); | |
3366 | 2069 gtk_object_set_user_data(GTK_OBJECT(button), options); |
1 | 2070 |
4064 | 2071 if (options == &misc_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2072 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_misc_option), |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2073 (int *)option); |
4064 | 2074 } else if (options == &logging_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2075 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_logging_option), |
3818 | 2076 (int *)option); |
4064 | 2077 } else if (options == &blist_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2078 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_blist_option), |
3818 | 2079 (int *)option); |
4064 | 2080 } else if (options == &convo_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2081 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_convo_option), |
3818 | 2082 (int *)option); |
4064 | 2083 } else if (options == &im_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2084 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_im_option), |
3818 | 2085 (int *)option); |
4064 | 2086 } else if (options == &chat_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2087 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_chat_option), |
3818 | 2088 (int *)option); |
4064 | 2089 } else if (options == &font_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2090 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_font_option), |
3818 | 2091 (int *)option); |
4064 | 2092 } else if (options == &sound_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2093 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_sound_option), |
3818 | 2094 (int *)option); |
4064 | 2095 } else if (options == &away_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2096 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_away_option), |
4064 | 2097 (int *)option); |
2098 } else { | |
2099 debug_printf("gaim_button: \"%s\" has no signal handler attached to it!\n", text); | |
2100 } | |
1 | 2101 gtk_widget_show(button); |
2102 | |
2103 return button; | |
2104 } | |
2105 | |
3366 | 2106 void away_list_clicked(GtkWidget *widget, struct away_message *a) |
2107 {} | |
2108 void default_away_menu_init(GtkWidget *omenu) | |
3032 | 2109 { |
3366 | 2110 GtkWidget *menu, *opt; |
2111 int index = 0; | |
2112 GSList *awy = away_messages; | |
2113 struct away_message *a; | |
2114 | |
2115 menu = gtk_menu_new(); | |
2116 | |
2117 while (awy) { | |
2118 a = (struct away_message *)awy->data; | |
2119 opt = gtk_menu_item_new_with_label(a->name); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2120 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_default_away), |
3366 | 2121 (gpointer)index); |
2122 gtk_widget_show(opt); | |
2123 gtk_menu_append(GTK_MENU(menu), opt); | |
2124 | |
2125 awy = awy->next; | |
2126 index++; | |
2127 } | |
2128 | |
2129 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2130 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
2131 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
2132 } | |
2133 | |
2134 GtkWidget *pref_fg_picture = NULL; | |
2135 GtkWidget *pref_bg_picture = NULL; | |
2136 | |
2137 void destroy_colorsel(GtkWidget *w, gpointer d) | |
2138 { | |
2139 if (d) { | |
2140 gtk_widget_destroy(fgcseld); | |
2141 fgcseld = NULL; | |
2142 } else { | |
2143 gtk_widget_destroy(bgcseld); | |
2144 bgcseld = NULL; | |
2145 } | |
3032 | 2146 } |
2147 | |
3366 | 2148 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 2149 { |
3366 | 2150 if ((int)d == 1) { |
2151 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2152 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3818 | 2153 &fgcolor); |
3366 | 2154 destroy_colorsel(NULL, (void *)1); |
2155 update_color(NULL, pref_fg_picture); | |
2156 } else { | |
2157 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2158 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3818 | 2159 &bgcolor); |
3366 | 2160 destroy_colorsel(NULL, (void *)0); |
2161 update_color(NULL, pref_bg_picture); | |
2162 } | |
4421 | 2163 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); |
3032 | 2164 } |
2165 | |
3366 | 2166 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 2167 { |
3366 | 2168 GdkColor c; |
2169 GtkStyle *style; | |
2170 c.pixel = 0; | |
3500 | 2171 |
3366 | 2172 if (pic == pref_fg_picture) { |
3818 | 2173 if (font_options & OPT_FONT_FGCOL) { |
2174 c.red = fgcolor.red; | |
2175 c.blue = fgcolor.blue; | |
2176 c.green = fgcolor.green; | |
3366 | 2177 } else { |
2178 c.red = 0; | |
2179 c.blue = 0; | |
2180 c.green = 0; | |
2181 } | |
2182 } else { | |
3818 | 2183 if (font_options & OPT_FONT_BGCOL) { |
2184 c.red = bgcolor.red; | |
2185 c.blue = bgcolor.blue; | |
2186 c.green = bgcolor.green; | |
3366 | 2187 } else { |
2188 c.red = 0xffff; | |
2189 c.blue = 0xffff; | |
2190 c.green = 0xffff; | |
2191 } | |
2192 } | |
2193 | |
2194 style = gtk_style_new(); | |
2195 style->bg[0] = c; | |
2196 gtk_widget_set_style(pic, style); | |
4296 | 2197 g_object_unref(style); |
3366 | 2198 } |
4064 | 2199 |
3366 | 2200 void set_default_away(GtkWidget *w, gpointer i) |
2201 { | |
2202 | |
2203 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
2204 |
3366 | 2205 if (away_messages == NULL) |
3818 | 2206 default_away = NULL; |
3366 | 2207 else if ((int)i >= length) |
3818 | 2208 default_away = g_slist_nth_data(away_messages, length - 1); |
3366 | 2209 else |
3818 | 2210 default_away = g_slist_nth_data(away_messages, (int)i); |
3366 | 2211 } |
3500 | 2212 |
4428 | 2213 static gboolean program_is_valid(const char *program) |
2214 { | |
2215 GError *error = NULL; | |
2216 char **argv; | |
2217 gboolean is_valid = FALSE; | |
2218 | |
2219 if (program == NULL || *program == '\0') { | |
2220 return FALSE; | |
2221 } | |
2222 | |
2223 if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
2224 debug_printf("Could not parse program '%s': ", error->message); | |
2225 return FALSE; | |
2226 } | |
2227 | |
2228 if (argv == NULL) { | |
2229 return FALSE; | |
2230 } | |
2231 | |
2232 is_valid = g_find_program_in_path(argv[0]) != NULL; | |
2233 | |
2234 g_strfreev(argv); | |
2235 | |
2236 return is_valid; | |
2237 } | |
2238 | |
3366 | 2239 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
2240 { | |
2241 int *value = gtk_object_get_user_data(GTK_OBJECT(spin)); | |
2242 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); | |
2243 } | |
4064 | 2244 |
3427 | 2245 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 2246 { |
2247 GtkWidget *hbox; | |
2248 GtkWidget *label; | |
2249 GtkWidget *spin; | |
2250 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
2251 |
3366 | 2252 hbox = gtk_hbox_new(FALSE, 5); |
2253 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
2254 gtk_widget_show(hbox); | |
2255 | |
3427 | 2256 label = gtk_label_new_with_mnemonic(title); |
3366 | 2257 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2258 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
2259 |
3366 | 2260 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
2261 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
2262 gtk_object_set_user_data(GTK_OBJECT(spin), val); | |
2263 gtk_widget_set_usize(spin, 50, -1); | |
2264 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2265 g_signal_connect(GTK_OBJECT(adjust), "value-changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2266 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
3366 | 2267 gtk_widget_show(spin); |
3500 | 2268 |
3427 | 2269 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
2270 | |
2271 if (sg) { | |
2272 gtk_size_group_add_widget(sg, label); | |
2273 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 2274 |
3427 | 2275 } |
2276 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2277 } |
1 | 2278 |
3366 | 2279 void dropdown_set(GtkObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2280 { |
3366 | 2281 int opt = (int)gtk_object_get_user_data(w); |
2282 int clear = (int)gtk_object_get_data(w, "clear"); | |
3500 | 2283 |
3366 | 2284 if (clear != -1) { |
2285 *option = *option & ~clear; | |
2286 *option = *option | opt; | |
2287 } else { | |
2288 debug_printf("HELLO %d\n", opt); | |
2289 *option = opt; | |
2290 } | |
3500 | 2291 |
4634 | 2292 if (option == (int*)&global_proxy_info.proxytype) { |
3366 | 2293 if (opt == PROXY_NONE) |
2294 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
2295 else | |
2296 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
3818 | 2297 } else if (option == &web_browser) { |
3366 | 2298 if (opt == BROWSER_MANUAL) |
4428 | 2299 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), TRUE); |
3366 | 2300 else |
4428 | 2301 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), FALSE); |
3818 | 2302 } else if (option == (int*)&sound_options) { |
3366 | 2303 if (opt == OPT_SOUND_CMD) |
2304 gtk_widget_set_sensitive(sndcmd, TRUE); | |
2305 else | |
2306 gtk_widget_set_sensitive(sndcmd, FALSE); | |
4581 | 2307 gaim_sound_change_output_method(); |
3818 | 2308 } else if (option == (int*)&im_options) { |
2309 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2310 gaim_gtkconv_update_tabs(); |
3818 | 2311 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2312 gaim_gtkconv_update_im_button_style(); |
3818 | 2313 } else if (option == (int*)&chat_options) { |
2314 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2315 gaim_gtkconv_update_tabs(); |
3818 | 2316 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2317 gaim_gtkconv_update_chat_button_style(); |
3818 | 2318 } else if (option == (int*)&blist_options) { |
2319 set_blist_tab(); | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2320 } else if (option == (int *)&conv_placement_option) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2321 gaim_conv_placement_set_active(conv_placement_option); |
3366 | 2322 } |
1 | 2323 } |
2324 | |
3500 | 2325 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 2326 { |
4428 | 2327 va_list ap; |
2328 GList *menuitems = NULL; | |
2329 GtkWidget *dropdown = NULL; | |
2330 char *name; | |
2331 int id; | |
2332 | |
2333 va_start(ap, clear); | |
2334 while ((name = va_arg(ap, char *)) != NULL) { | |
2335 id = va_arg(ap, int); | |
2336 | |
2337 menuitems = g_list_prepend(menuitems, name); | |
2338 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(id)); | |
2339 } | |
2340 va_end(ap); | |
2341 | |
4433 | 2342 g_return_val_if_fail(menuitems != NULL, NULL); |
4428 | 2343 |
2344 menuitems = g_list_reverse(menuitems); | |
2345 | |
2346 dropdown = gaim_dropdown_from_list(box, title, option, clear, menuitems); | |
2347 | |
2348 g_list_free(menuitems); | |
2349 | |
2350 return dropdown; | |
2351 } | |
2352 | |
2353 static GtkWidget *gaim_dropdown_from_list(GtkWidget *box, const gchar *title, int *option, int clear, GList *menuitems) | |
2354 { | |
3366 | 2355 GtkWidget *dropdown, *opt, *menu; |
2356 GtkWidget *label; | |
2357 gchar *text; | |
2358 int value; | |
2359 int o = 0; | |
2360 GtkWidget *hbox; | |
1 | 2361 |
4428 | 2362 g_return_val_if_fail(menuitems != NULL, NULL); |
2363 | |
3366 | 2364 hbox = gtk_hbox_new(FALSE, 5); |
2365 gtk_container_add (GTK_CONTAINER (box), hbox); | |
2366 gtk_widget_show(hbox); | |
2367 | |
3427 | 2368 label = gtk_label_new_with_mnemonic(title); |
3366 | 2369 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2370 gtk_widget_show(label); | |
2371 | |
2372 dropdown = gtk_option_menu_new(); | |
2373 menu = gtk_menu_new(); | |
3500 | 2374 |
3427 | 2375 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 2376 |
4428 | 2377 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
2378 menuitems = g_list_next(menuitems); | |
2379 g_return_val_if_fail(menuitems != NULL, NULL); | |
2380 value = GPOINTER_TO_INT(menuitems->data); | |
2381 menuitems = g_list_next(menuitems); | |
2382 | |
3366 | 2383 opt = gtk_menu_item_new_with_label(text); |
2384 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value); | |
2385 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2386 g_signal_connect(GTK_OBJECT(opt), "activate", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2387 G_CALLBACK(dropdown_set), (void *)option); |
3366 | 2388 gtk_widget_show(opt); |
2389 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 2390 |
3366 | 2391 if (((clear > -1) && ((*option & value) == value)) || *option == value) { |
2392 gtk_menu_set_active(GTK_MENU(menu), o); | |
2393 } | |
2394 o++; | |
4428 | 2395 |
3366 | 2396 } |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2397 |
3500 | 2398 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 2399 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
2400 gtk_widget_show(dropdown); | |
3427 | 2401 return label; |
3500 | 2402 } |
2403 | |
3366 | 2404 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 2405 { |
3366 | 2406 /* more stuff stolen from X-Chat */ |
2407 GtkWidget *swid; | |
2408 GdkColor c; | |
2409 GtkStyle *style; | |
2410 c.pixel = 0; | |
2411 if (fgc) { | |
3818 | 2412 if (font_options & OPT_FONT_FGCOL) { |
2413 c.red = fgcolor.red; | |
2414 c.blue = fgcolor.blue; | |
2415 c.green = fgcolor.green; | |
3366 | 2416 } else { |
2417 c.red = 0; | |
2418 c.blue = 0; | |
2419 c.green = 0; | |
2420 } | |
2421 } else { | |
3818 | 2422 if (font_options & OPT_FONT_BGCOL) { |
2423 c.red = bgcolor.red; | |
2424 c.blue = bgcolor.blue; | |
2425 c.green = bgcolor.green; | |
3366 | 2426 } else { |
2427 c.red = 0xffff; | |
2428 c.blue = 0xffff; | |
2429 c.green = 0xffff; | |
2430 } | |
2431 } | |
1 | 2432 |
3366 | 2433 style = gtk_style_new(); |
2434 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2435 |
3366 | 2436 swid = gtk_event_box_new(); |
2437 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
4296 | 2438 g_object_unref(style); |
3366 | 2439 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1); |
2440 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2441 gtk_widget_show(swid); | |
2442 return swid; | |
1 | 2443 } |
4064 | 2444 |
3366 | 2445 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2446 { |
3366 | 2447 int i = 0; |
2448 char *fontname; | |
2449 | |
3473 | 2450 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 2451 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2452 |
3818 | 2453 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
2454 fontface[i] = fontname[i]; | |
3366 | 2455 i++; |
2456 } | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2457 |
3818 | 2458 fontface[i] = 0; |
3366 | 2459 g_free(fontname); |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2460 |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2461 gaim_conversation_foreach(gaim_gtkconv_update_font_face); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2462 } |
3500 | 2463 |