Mercurial > pidgin.yaz
annotate src/gtkprefs.c @ 8231:f50c059b6384
[gaim-migrate @ 8954]
This is Tim Ringenbach's patch to move some IP-related functions into the
new gaim_network namespace, improve the local IP checking functionality by
opening a socket, change some prefs, and add the ability to modify these
prefs in the UI. Some ft.c bugs were fixed, and OSCAR, Jabber and Yahoo
were updated to reflect the changes. The DCC SEND portion of this patch was
not committed, as per his request (unless I misunderstood? :)
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 12 Feb 2004 00:36:55 +0000 |
parents | cd9ea20cd8ed |
children | 32625c0dbba6 |
rev | line source |
---|---|
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1 /** |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2 * @file gtkprefs.c GTK+ Preferences |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
3 * @ingroup gtkui |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
4 * |
5440 | 5 * gaim |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
5440 | 10 * |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 * | |
25 */ | |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6216
diff
changeset
|
26 #include "gtkinternal.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
27 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
28 #include "debug.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
29 #include "notify.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
30 #include "prefs.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
31 #include "proxy.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
32 #include "prpl.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
33 #include "sound.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
34 #include "util.h" |
8170 | 35 #include "multi.h" |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
36 #include "network.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
37 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
38 #include "gtkblist.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
39 #include "gtkconv.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
40 #include "gtkdebug.h" |
5440 | 41 #include "gtkimhtml.h" |
42 #include "gtkplugin.h" | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
43 #include "gtkprefs.h" |
5684 | 44 #include "gtksound.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
45 #include "gtkutils.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
46 #include "stock.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
47 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
48 #include "ui.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
49 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
50 #define PROXYHOST 0 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
51 #define PROXYPORT 1 |
6005 | 52 #define PROXYUSER 2 |
53 #define PROXYPASS 3 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
54 |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
55 /* XXX This needs to be made static after we solve the away.c mess. */ |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
56 GtkListStore *prefs_away_store = NULL; |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
57 GtkWidget *prefs_away_menu = NULL; |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
58 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
59 static GtkWidget *tree_v = NULL; |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
60 |
5440 | 61 |
62 static int sound_row_sel = 0; | |
63 static char *last_sound_dir = NULL; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
64 static GtkWidget *preflabel; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
65 static GtkWidget *prefsnotebook; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
66 static GtkTreeStore *prefstree; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
67 |
5440 | 68 |
69 static GtkWidget *sounddialog = NULL; | |
70 static GtkWidget *sound_entry = NULL; | |
71 static GtkWidget *away_text = NULL; | |
72 static GtkListStore *smiley_theme_store = NULL; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
73 static GtkWidget *prefs_proxy_frame = NULL; |
5440 | 74 |
75 static GtkWidget *prefs = NULL; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
76 static GtkWidget *debugbutton = NULL; |
5440 | 77 static int notebook_page = 0; |
78 static GtkTreeIter plugin_iter; | |
79 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
80 static guint browser_pref_id = 0; |
6001 | 81 static guint proxy_pref_id = 0; |
6005 | 82 static guint sound_pref_id = 0; |
6142 | 83 static guint auto_resp_pref_id = 0; |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
84 |
5440 | 85 /* |
86 * PROTOTYPES | |
87 */ | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
88 static GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
89 GtkWidget*, GtkTreeIter*, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
90 GtkTreeIter*, int); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
91 static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
92 static void delete_prefs(GtkWidget *, void *); |
5440 | 93 static void update_plugin_list(void *data); |
94 | |
7931 | 95 static void set_default_away(GtkWidget *, gpointer); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
96 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
97 static void |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
98 update_spin_value(GtkWidget *w, GtkWidget *spin) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
99 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
100 const char *key = g_object_get_data(G_OBJECT(spin), "val"); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
101 int value; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
102 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
103 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
104 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
105 gaim_prefs_set_int(key, value); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
106 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
107 |
7976 | 108 GtkWidget * |
7987 | 109 gaim_gtk_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
110 char *key, int min, int max, GtkSizeGroup *sg) | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
111 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
112 GtkWidget *hbox; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
113 GtkWidget *label; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
114 GtkWidget *spin; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
115 GtkObject *adjust; |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
116 int val; |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
117 |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
118 val = gaim_prefs_get_int(key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
119 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
120 hbox = gtk_hbox_new(FALSE, 5); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
121 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
122 gtk_widget_show(hbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
123 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
124 label = gtk_label_new_with_mnemonic(title); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
125 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
126 gtk_widget_show(label); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
127 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
128 adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
129 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
130 g_object_set_data(G_OBJECT(spin), "val", key); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
131 gtk_widget_set_size_request(spin, 50, -1); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
132 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
133 g_signal_connect(G_OBJECT(adjust), "value-changed", |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
134 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
135 gtk_widget_show(spin); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
136 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
137 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
138 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
139 if (sg) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
140 gtk_size_group_add_widget(sg, label); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
141 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
142 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
143 |
8137 | 144 gaim_set_accessible_label (spin, label); |
145 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
146 return label; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
147 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
148 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
149 static void |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
150 dropdown_set(GObject *w, const char *key) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
151 { |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
152 const char *bool_key; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
153 const char *str_value; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
154 int int_value; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
155 GaimPrefType type; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
156 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
157 type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
158 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
159 if (type == GAIM_PREF_INT) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
160 int_value = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
161 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
162 gaim_prefs_set_int(key, int_value); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
163 } |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
164 else if (type == GAIM_PREF_STRING) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
165 str_value = (const char *)g_object_get_data(w, "value"); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
166 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
167 gaim_prefs_set_string(key, str_value); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
168 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
169 else if (type == GAIM_PREF_BOOLEAN) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
170 bool_key = (const char *)g_object_get_data(w, "value"); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
171 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
172 if (!strcmp(key, bool_key)) |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
173 return; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
174 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
175 gaim_prefs_set_bool(key, FALSE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
176 gaim_prefs_set_bool(bool_key, TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
177 } |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
178 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
179 |
7976 | 180 GtkWidget * |
7987 | 181 gaim_gtk_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
182 GaimPrefType type, const char *key, GList *menuitems) | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
183 { |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
184 GtkWidget *dropdown, *opt, *menu; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
185 GtkWidget *label; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
186 GtkWidget *hbox; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
187 gchar *text; |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
188 const char *bool_key = NULL; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
189 const char *stored_str = NULL; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
190 int stored_int = 0; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
191 int int_value = 0; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
192 const char *str_value = NULL; |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
193 int o = 0; |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
194 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
195 g_return_val_if_fail(menuitems != NULL, NULL); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
196 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
197 hbox = gtk_hbox_new(FALSE, 5); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
198 gtk_container_add (GTK_CONTAINER (box), hbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
199 gtk_widget_show(hbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
200 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
201 label = gtk_label_new_with_mnemonic(title); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
202 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
203 gtk_widget_show(label); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
204 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
205 dropdown = gtk_option_menu_new(); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
206 menu = gtk_menu_new(); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
207 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
208 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
209 |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
210 if (type == GAIM_PREF_INT) |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
211 stored_int = gaim_prefs_get_int(key); |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
212 else if (type == GAIM_PREF_STRING) |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
213 stored_str = gaim_prefs_get_string(key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
214 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
215 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
216 menuitems = g_list_next(menuitems); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
217 g_return_val_if_fail(menuitems != NULL, NULL); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
218 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
219 opt = gtk_menu_item_new_with_label(text); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
220 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
221 g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type)); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
222 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
223 if (type == GAIM_PREF_INT) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
224 int_value = GPOINTER_TO_INT(menuitems->data); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
225 g_object_set_data(G_OBJECT(opt), "value", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
226 GINT_TO_POINTER(int_value)); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
227 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
228 else if (type == GAIM_PREF_STRING) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
229 str_value = (const char *)menuitems->data; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
230 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
231 g_object_set_data(G_OBJECT(opt), "value", (char *)str_value); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
232 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
233 else if (type == GAIM_PREF_BOOLEAN) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
234 bool_key = (const char *)menuitems->data; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
235 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
236 g_object_set_data(G_OBJECT(opt), "value", (char *)bool_key); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
237 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
238 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
239 g_signal_connect(G_OBJECT(opt), "activate", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
240 G_CALLBACK(dropdown_set), (char *)key); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
241 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
242 gtk_widget_show(opt); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
243 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
244 |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
245 if ((type == GAIM_PREF_INT && stored_int == int_value) || |
5753
96214f5de47c
[gaim-migrate @ 6178]
Christian Hammond <chipx86@chipx86.com>
parents:
5716
diff
changeset
|
246 (type == GAIM_PREF_STRING && stored_str != NULL && |
96214f5de47c
[gaim-migrate @ 6178]
Christian Hammond <chipx86@chipx86.com>
parents:
5716
diff
changeset
|
247 !strcmp(stored_str, str_value)) || |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
248 (type == GAIM_PREF_BOOLEAN && gaim_prefs_get_bool(bool_key))) { |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
249 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
250 gtk_menu_set_active(GTK_MENU(menu), o); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
251 } |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
252 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
253 menuitems = g_list_next(menuitems); |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
254 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
255 o++; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
256 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
257 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
258 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
259 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
260 gtk_widget_show(dropdown); |
8137 | 261 gaim_set_accessible_label (dropdown, label); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
262 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
263 return label; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
264 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
265 |
7976 | 266 GtkWidget * |
7987 | 267 gaim_gtk_prefs_dropdown(GtkWidget *box, const gchar *title, GaimPrefType type, |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
268 const char *key, ...) |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
269 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
270 va_list ap; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
271 GList *menuitems = NULL; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
272 GtkWidget *dropdown = NULL; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
273 char *name; |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
274 int int_value; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
275 const char *str_value; |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
276 |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
277 va_start(ap, key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
278 while ((name = va_arg(ap, char *)) != NULL) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
279 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
280 menuitems = g_list_prepend(menuitems, name); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
281 |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
282 if (type == GAIM_PREF_INT) { |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
283 int_value = va_arg(ap, int); |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
284 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value)); |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
285 } |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
286 else { |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
287 str_value = va_arg(ap, const char *); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
288 menuitems = g_list_prepend(menuitems, (char *)str_value); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
289 } |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
290 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
291 va_end(ap); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
292 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
293 g_return_val_if_fail(menuitems != NULL, NULL); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
294 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
295 menuitems = g_list_reverse(menuitems); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
296 |
7987 | 297 dropdown = gaim_gtk_prefs_dropdown_from_list(box, title, type, key, |
298 menuitems); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
299 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
300 g_list_free(menuitems); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
301 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
302 return dropdown; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
303 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
304 |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
305 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
306 delete_prefs(GtkWidget *asdf, void *gdsa) |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
307 { |
5440 | 308 GList *l; |
309 GaimPlugin *plug; | |
310 | |
311 gaim_plugins_unregister_probe_notify_cb(update_plugin_list); | |
312 | |
313 prefs = NULL; | |
314 tree_v = NULL; | |
315 sound_entry = NULL; | |
316 debugbutton = NULL; | |
317 prefs_away_menu = NULL; | |
318 notebook_page = 0; | |
319 smiley_theme_store = NULL; | |
320 if(sounddialog) | |
321 gtk_widget_destroy(sounddialog); | |
322 g_object_unref(G_OBJECT(prefs_away_store)); | |
323 prefs_away_store = NULL; | |
324 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
325 /* Unregister callbacks. */ |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
326 gaim_prefs_disconnect_callback(browser_pref_id); |
6001 | 327 gaim_prefs_disconnect_callback(proxy_pref_id); |
6005 | 328 gaim_prefs_disconnect_callback(sound_pref_id); |
6142 | 329 gaim_prefs_disconnect_callback(auto_resp_pref_id); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
330 |
5440 | 331 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { |
332 plug = l->data; | |
333 | |
334 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
335 GaimGtkPluginUiInfo *ui_info; | |
336 | |
337 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
338 | |
339 if (ui_info->iter != NULL) { | |
340 g_free(ui_info->iter); | |
341 ui_info->iter = NULL; | |
342 } | |
343 } | |
344 } | |
345 } | |
346 | |
347 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
348 GtkTreeIter iter; | |
349 char text[128]; | |
350 GValue val = { 0, }; | |
351 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
352 | |
353 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
354 return; | |
355 gtk_tree_model_get_value (model, &iter, 1, &val); | |
356 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", | |
357 g_value_get_string(&val)); | |
358 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
359 g_value_unset (&val); | |
360 gtk_tree_model_get_value (model, &iter, 2, &val); | |
361 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
362 | |
363 } | |
364 | |
365 /* These are the pages in the preferences notebook */ | |
366 GtkWidget *interface_page() { | |
367 GtkWidget *ret; | |
368 GtkWidget *vbox; | |
369 ret = gtk_vbox_new(FALSE, 18); | |
370 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
371 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
372 vbox = gaim_gtk_make_frame(ret, _("Interface Options")); |
5440 | 373 |
7987 | 374 gaim_gtk_prefs_checkbox(_("D_isplay remote nicknames if no alias is set"), |
375 "/core/buddies/use_server_alias", vbox); | |
5440 | 376 |
377 | |
378 gtk_widget_show_all(ret); | |
379 return ret; | |
380 } | |
381 | |
382 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
383 GtkTreeIter iter; | |
384 const char *filename; | |
385 GValue val = { 0, }; | |
5841 | 386 |
5440 | 387 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
388 return; | |
389 gtk_tree_model_get_value (model, &iter, 2, &val); | |
390 filename = g_value_get_string(&val); | |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
391 gaim_prefs_set_string("/gaim/gtk/smileys/theme", filename); |
5440 | 392 g_value_unset (&val); |
393 } | |
394 | |
395 GtkTreePath *theme_refresh_theme_list() | |
396 { | |
397 GdkPixbuf *pixbuf; | |
398 GSList *themes; | |
399 GtkTreeIter iter; | |
400 GtkTreePath *path = NULL; | |
401 int ind = 0; | |
402 | |
403 | |
404 smiley_theme_probe(); | |
405 | |
406 if (!smiley_themes) | |
407 return NULL; | |
408 | |
409 themes = smiley_themes; | |
410 | |
411 gtk_list_store_clear(smiley_theme_store); | |
412 | |
413 while (themes) { | |
414 struct smiley_theme *theme = themes->data; | |
415 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
416 "<span size='smaller' foreground='dim grey'>%s</span>", | |
417 theme->name, theme->author, theme->desc); | |
418 gtk_list_store_append (smiley_theme_store, &iter); | |
419 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); | |
420 | |
421 gtk_list_store_set(smiley_theme_store, &iter, | |
422 0, pixbuf, | |
423 1, description, | |
424 2, theme->path, | |
425 -1); | |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
426 |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
427 if (pixbuf != NULL) |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
428 g_object_unref(G_OBJECT(pixbuf)); |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
429 |
5440 | 430 g_free(description); |
431 themes = themes->next; | |
432 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
433 /* path = gtk_tree_path_new_from_indices(ind); */ | |
434 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
435 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
436 g_free(iwishihadgtk2_2); | |
437 } | |
438 ind++; | |
439 } | |
440 | |
441 return path; | |
442 } | |
443 | |
444 void theme_install_theme(char *path, char *extn) { | |
445 #ifndef _WIN32 | |
446 gchar *command; | |
447 #endif | |
448 gchar *destdir; | |
449 gchar *tail; | |
450 | |
451 /* Just to be safe */ | |
452 g_strchomp(path); | |
453 | |
454 /* I dont know what you are, get out of here */ | |
455 if (extn != NULL) | |
456 tail = extn; | |
457 else if ((tail = strrchr(path, '.')) == NULL) | |
458 return; | |
459 | |
460 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); | |
461 | |
462 /* We'll check this just to make sure. This also lets us do something different on | |
463 * other platforms, if need be */ | |
464 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { | |
465 #ifndef _WIN32 | |
466 command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); | |
467 #else | |
468 if(!wgaim_gz_untar(path, destdir)) { | |
469 g_free(destdir); | |
470 return; | |
471 } | |
472 #endif | |
473 } | |
474 else { | |
475 g_free(destdir); | |
476 return; | |
477 } | |
478 | |
479 #ifndef _WIN32 | |
480 /* Fire! */ | |
481 system(command); | |
482 | |
483 g_free(command); | |
484 #endif | |
485 g_free(destdir); | |
486 | |
487 theme_refresh_theme_list(); | |
488 } | |
489 | |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
490 static void |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
491 theme_got_url(void *data, const char *themedata, size_t len) |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
492 { |
5440 | 493 FILE *f; |
494 gchar *path; | |
495 | |
496 f = gaim_mkstemp(&path); | |
497 fwrite(themedata, len, 1, f); | |
498 fclose(f); | |
499 | |
500 theme_install_theme(path, data); | |
501 | |
502 unlink(path); | |
503 g_free(path); | |
504 } | |
505 | |
506 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, | |
507 guint info, guint t, gpointer data) { | |
508 gchar *name = sd->data; | |
509 | |
510 if ((sd->length >= 0) && (sd->format == 8)) { | |
511 /* Well, it looks like the drag event was cool. | |
512 * Let's do something with it */ | |
513 | |
514 if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
515 GError *converr = NULL; | |
516 gchar *tmp; | |
517 /* It looks like we're dealing with a local file. Let's | |
518 * just untar it in the right place */ | |
519 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { | |
520 gaim_debug(GAIM_DEBUG_ERROR, "theme dnd", "%s\n", | |
521 (converr ? converr->message : | |
522 "g_filename_from_uri error")); | |
523 return; | |
524 } | |
525 theme_install_theme(tmp, NULL); | |
526 g_free(tmp); | |
527 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { | |
528 /* Oo, a web drag and drop. This is where things | |
529 * will start to get interesting */ | |
530 gchar *tail; | |
531 | |
532 if ((tail = strrchr(name, '.')) == NULL) | |
533 return; | |
534 | |
535 /* We'll check this just to make sure. This also lets us do something different on | |
536 * other platforms, if need be */ | |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
537 gaim_url_fetch(name, TRUE, NULL, FALSE, theme_got_url, ".tgz"); |
5440 | 538 } |
539 | |
540 gtk_drag_finish(dc, TRUE, FALSE, t); | |
541 } | |
542 | |
543 gtk_drag_finish(dc, FALSE, FALSE, t); | |
544 } | |
545 | |
546 GtkWidget *theme_page() { | |
547 GtkWidget *ret; | |
548 GtkWidget *sw; | |
549 GtkWidget *view; | |
550 GtkCellRenderer *rend; | |
551 GtkTreeViewColumn *col; | |
552 GtkTreeSelection *sel; | |
553 GtkTreePath *path = NULL; | |
554 GtkWidget *label; | |
555 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; | |
556 | |
557 ret = gtk_vbox_new(FALSE, 18); | |
558 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
559 | |
560 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.")); | |
561 | |
562 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
563 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
564 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
565 | |
566 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
567 gtk_widget_show(label); | |
568 | |
569 sw = gtk_scrolled_window_new(NULL,NULL); | |
7939 | 570 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
7931 | 571 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
5440 | 572 |
573 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
574 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
575 | |
576 path = theme_refresh_theme_list(); | |
8075 | 577 |
5440 | 578 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
579 | |
580 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
581 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
582 | |
583 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
584 | |
585 rend = gtk_cell_renderer_pixbuf_new(); | |
586 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
587 | |
588 if(path) { | |
589 gtk_tree_selection_select_path(sel, path); | |
590 gtk_tree_path_free(path); | |
591 } | |
8075 | 592 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store), |
593 1, GTK_SORT_ASCENDING); | |
5440 | 594 |
595 col = gtk_tree_view_column_new_with_attributes (_("Icon"), | |
596 rend, | |
597 "pixbuf", 0, | |
598 NULL); | |
599 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
600 | |
601 rend = gtk_cell_renderer_text_new(); | |
602 col = gtk_tree_view_column_new_with_attributes (_("Description"), | |
603 rend, | |
604 "markup", 1, | |
605 NULL); | |
606 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
607 g_object_unref(G_OBJECT(smiley_theme_store)); | |
608 gtk_container_add(GTK_CONTAINER(sw), view); | |
609 | |
8075 | 610 g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL); |
5440 | 611 |
612 gtk_widget_show_all(ret); | |
8137 | 613 |
614 gaim_set_accessible_label (view, label); | |
615 | |
5440 | 616 return ret; |
617 } | |
618 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
619 static void update_color(GtkWidget *w, GtkWidget *pic) |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
620 { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
621 GdkColor c; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
622 GtkStyle *style; |
5627 | 623 GdkColor color; |
624 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
625 c.pixel = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
626 |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
627 if (pic == pref_fg_picture) { |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
628 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
629 gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
630 &color); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
631 c.red = color.red; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
632 c.blue = color.blue; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
633 c.green = color.green; |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
634 } else { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
635 c.red = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
636 c.blue = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
637 c.green = 0; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
638 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
639 } else { |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
640 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
641 gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
642 &color); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
643 c.red = color.red; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
644 c.blue = color.blue; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
645 c.green = color.green; |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
646 } else { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
647 c.red = 0xffff; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
648 c.blue = 0xffff; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
649 c.green = 0xffff; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
650 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
651 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
652 |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
653 style = gtk_style_new(); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
654 style->bg[0] = c; |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
655 gtk_widget_set_style(pic, style); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
656 g_object_unref(style); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
657 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
658 |
5440 | 659 GtkWidget *font_page() { |
660 GtkWidget *ret; | |
661 GtkWidget *button; | |
662 GtkWidget *vbox, *hbox; | |
663 GtkWidget *select = NULL; | |
664 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
665 | |
666 ret = gtk_vbox_new(FALSE, 18); | |
667 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
668 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
669 vbox = gaim_gtk_make_frame(ret, _("Style")); |
7987 | 670 gaim_gtk_prefs_checkbox(_("_Bold"), |
671 "/gaim/gtk/conversations/send_bold", vbox); | |
672 gaim_gtk_prefs_checkbox(_("_Italics"), | |
673 "/gaim/gtk/conversations/send_italic", vbox); | |
674 gaim_gtk_prefs_checkbox(_("_Underline"), | |
675 "/gaim/gtk/conversations/send_underline", vbox); | |
676 gaim_gtk_prefs_checkbox(_("_Strikethrough"), | |
677 "/gaim/gtk/conversations/send_strikethrough", vbox); | |
5440 | 678 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
679 vbox = gaim_gtk_make_frame(ret, _("Face")); |
5440 | 680 hbox = gtk_hbox_new(FALSE, 6); |
681 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
7987 | 682 button = gaim_gtk_prefs_checkbox(_("Use custo_m face"), |
683 "/gaim/gtk/conversations/use_custom_font", hbox); | |
5440 | 684 gtk_size_group_add_widget(sg, button); |
685 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
686 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
687 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_font")) |
5440 | 688 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
689 |
5440 | 690 g_signal_connect(G_OBJECT(button), "clicked", |
691 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
692 g_signal_connect(G_OBJECT(select), "clicked", | |
693 G_CALLBACK(show_font_dialog), NULL); | |
694 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
695 | |
696 hbox = gtk_hbox_new(FALSE, 5); | |
697 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
698 |
7987 | 699 button = gaim_gtk_prefs_checkbox(_("Use custom si_ze"), |
700 "/gaim/gtk/conversations/use_custom_size", hbox); | |
5440 | 701 gtk_size_group_add_widget(sg, button); |
7987 | 702 select = gaim_gtk_prefs_labeled_spin_button(hbox, NULL, |
703 "/gaim/gtk/conversations/font_size", 1, 7, NULL); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
704 |
6384
6e5dbdaf33f2
[gaim-migrate @ 6889]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
705 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_size")) |
5440 | 706 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
707 |
5440 | 708 g_signal_connect(G_OBJECT(button), "clicked", |
709 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
710 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
711 vbox = gaim_gtk_make_frame(ret, _("Color")); |
5440 | 712 hbox = gtk_hbox_new(FALSE, 5); |
713 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
714 | |
7987 | 715 button = gaim_gtk_prefs_checkbox(_("_Text color"), |
716 "/gaim/gtk/conversations/use_custom_fgcolor", hbox); | |
5440 | 717 gtk_size_group_add_widget(sg, button); |
718 | |
719 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
720 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
721 pref_fg_picture = show_color_pref(hbox, TRUE); | |
722 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(update_color), | |
723 pref_fg_picture); | |
724 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
725 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) |
5440 | 726 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
727 |
5440 | 728 g_signal_connect(G_OBJECT(button), "clicked", |
729 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
730 g_signal_connect(G_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); | |
731 hbox = gtk_hbox_new(FALSE, 5); | |
732 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
733 | |
7987 | 734 button = gaim_gtk_prefs_checkbox(_("Bac_kground color"), |
735 "/gaim/gtk/conversations/use_custom_bgcolor", hbox); | |
5440 | 736 gtk_size_group_add_widget(sg, button); |
737 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
738 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
739 pref_bg_picture = show_color_pref(hbox, FALSE); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
740 g_signal_connect(G_OBJECT(button), "clicked", |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
741 G_CALLBACK(update_color), pref_bg_picture); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
742 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
743 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) |
5440 | 744 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
745 |
5440 | 746 g_signal_connect(G_OBJECT(select), "clicked", |
747 G_CALLBACK(show_bgcolor_dialog), NULL); | |
748 g_signal_connect(G_OBJECT(button), "clicked", | |
749 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
750 | |
751 gtk_widget_show_all(ret); | |
752 return ret; | |
753 } | |
754 | |
755 | |
756 GtkWidget *messages_page() { | |
757 GtkWidget *ret; | |
758 GtkWidget *vbox; | |
759 ret = gtk_vbox_new(FALSE, 18); | |
760 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
761 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
762 vbox = gaim_gtk_make_frame (ret, _("Display")); |
7987 | 763 gaim_gtk_prefs_checkbox(_("Show graphical _smileys"), |
764 "/gaim/gtk/conversations/show_smileys", vbox); | |
765 gaim_gtk_prefs_checkbox(_("Show _timestamp on messages"), | |
766 "/gaim/gtk/conversations/show_timestamps", vbox); | |
767 gaim_gtk_prefs_checkbox(_("Show _URLs as links"), | |
768 "/gaim/gtk/conversations/show_urls_as_links", vbox); | |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
769 |
5440 | 770 #ifdef USE_GTKSPELL |
7987 | 771 gaim_gtk_prefs_checkbox(_("_Highlight misspelled words"), |
772 "/gaim/gtk/conversations/spellcheck", vbox); | |
5440 | 773 #endif |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
774 vbox = gaim_gtk_make_frame (ret, _("Ignore")); |
7987 | 775 gaim_gtk_prefs_checkbox(_("Ignore c_olors"), |
776 "/gaim/gtk/conversations/ignore_colors", vbox); | |
777 gaim_gtk_prefs_checkbox(_("Ignore font _faces"), | |
778 "/gaim/gtk/conversations/ignore_fonts", vbox); | |
779 gaim_gtk_prefs_checkbox(_("Ignore font si_zes"), | |
780 "/gaim/gtk/conversations/ignore_font_sizes", vbox); | |
5440 | 781 |
782 gtk_widget_show_all(ret); | |
783 return ret; | |
784 } | |
785 | |
786 GtkWidget *hotkeys_page() { | |
787 GtkWidget *ret; | |
788 GtkWidget *vbox; | |
789 ret = gtk_vbox_new(FALSE, 18); | |
790 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
791 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
792 vbox = gaim_gtk_make_frame(ret, _("Send Message")); |
7987 | 793 gaim_gtk_prefs_checkbox(_("Enter _sends message"), |
794 "/gaim/gtk/conversations/enter_sends", vbox); | |
795 gaim_gtk_prefs_checkbox(_("C_ontrol-Enter sends message"), | |
796 "/gaim/gtk/conversations/ctrl_enter_sends", vbox); | |
5440 | 797 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
798 vbox = gaim_gtk_make_frame (ret, _("Window Closing")); |
7987 | 799 gaim_gtk_prefs_checkbox(_("_Escape closes window"), |
800 "/gaim/gtk/conversations/escape_closes", vbox); | |
5440 | 801 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
802 vbox = gaim_gtk_make_frame(ret, _("Insertions")); |
7987 | 803 gaim_gtk_prefs_checkbox(_("Control-{B/I/U} inserts _HTML tags"), |
804 "/gaim/gtk/conversations/html_shortcuts", vbox); | |
805 gaim_gtk_prefs_checkbox(_("Control-(number) _inserts smileys"), | |
806 "/gaim/gtk/conversations/smiley_shortcuts", vbox); | |
5440 | 807 |
808 gtk_widget_show_all(ret); | |
809 return ret; | |
810 } | |
811 | |
812 GtkWidget *list_page() { | |
813 GtkWidget *ret; | |
814 GtkWidget *vbox; | |
815 GList *l= NULL; | |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
816 GSList *sl; |
5440 | 817 ret = gtk_vbox_new(FALSE, 18); |
818 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
7305 | 819 |
820 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
821 vbox = gaim_gtk_make_frame (ret, _("Buddy List Sorting")); |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
822 |
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
823 for (sl = gaim_gtk_blist_sort_methods; sl != NULL; sl = sl->next) { |
5631 | 824 struct gaim_gtk_blist_sort_method *method = sl->data; |
825 | |
826 l = g_list_append(l, method->name); | |
827 l = g_list_append(l, method->id); | |
5440 | 828 } |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
829 |
8063 | 830 gaim_gtk_prefs_dropdown_from_list(vbox, _("_Sorting:"), GAIM_PREF_STRING, |
7987 | 831 "/gaim/gtk/blist/sort_type", l); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
832 |
5440 | 833 g_list_free(l); |
834 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
835 vbox = gaim_gtk_make_frame (ret, _("Buddy List Toolbar")); |
7987 | 836 gaim_gtk_prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
837 "/gaim/gtk/blist/button_style", | |
838 _("Pictures"), GAIM_BUTTON_IMAGE, | |
839 _("Text"), GAIM_BUTTON_TEXT, | |
840 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, | |
841 _("None"), GAIM_BUTTON_NONE, | |
842 NULL); | |
5440 | 843 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
844 vbox = gaim_gtk_make_frame (ret, _("Buddy List Window")); |
7987 | 845 gaim_gtk_prefs_checkbox(_("_Raise window on events"), |
846 "/gaim/gtk/blist/raise_on_events", vbox); | |
5440 | 847 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
848 vbox = gaim_gtk_make_frame (ret, _("Group Display")); |
7987 | 849 gaim_gtk_prefs_checkbox(_("Show _numbers in groups"), |
850 "/gaim/gtk/blist/show_group_count", vbox); | |
5440 | 851 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
852 vbox = gaim_gtk_make_frame (ret, _("Buddy Display")); |
7987 | 853 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), |
7305 | 854 "/gaim/gtk/blist/show_buddy_icons", vbox); |
7987 | 855 gaim_gtk_prefs_checkbox(_("Show _warning levels"), |
7305 | 856 "/gaim/gtk/blist/show_warning_level", vbox); |
7987 | 857 gaim_gtk_prefs_checkbox(_("Show idle _times"), |
7305 | 858 "/gaim/gtk/blist/show_idle_time", vbox); |
7987 | 859 gaim_gtk_prefs_checkbox(_("Dim i_dle buddies"), |
7305 | 860 "/gaim/gtk/blist/grey_idle_buddies", vbox); |
7987 | 861 gaim_gtk_prefs_checkbox(_("_Automatically expand contacts"), |
7731 | 862 "/gaim/gtk/blist/auto_expand_contacts", vbox); |
5440 | 863 |
864 gtk_widget_show_all(ret); | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
865 |
5440 | 866 return ret; |
867 } | |
868 | |
869 GtkWidget *conv_page() { | |
870 GtkWidget *ret; | |
871 GtkWidget *vbox; | |
872 GtkWidget *label; | |
7128 | 873 GtkWidget *close_checkbox, *icons_checkbox; |
874 GtkWidget *tabs_checkbox, *same_checkbox; | |
5440 | 875 GtkSizeGroup *sg; |
876 GList *names = NULL; | |
877 | |
878 ret = gtk_vbox_new(FALSE, 18); | |
879 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
880 | |
881 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
882 vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
5440 | 883 |
5858 | 884 names = gaim_conv_placement_get_options(); |
5440 | 885 |
7987 | 886 label = gaim_gtk_prefs_dropdown_from_list(vbox, _("_Placement:"), |
7561
cdfdbabd3266
[gaim-migrate @ 8175]
Christian Hammond <chipx86@chipx86.com>
parents:
7553
diff
changeset
|
887 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); |
5440 | 888 g_list_free(names); |
889 | |
890 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
891 gtk_size_group_add_widget(sg, label); | |
892 | |
7987 | 893 gaim_gtk_prefs_checkbox(_("Send _URLs as Links"), |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
894 "/core/conversations/send_urls_as_links", vbox); |
5440 | 895 |
8063 | 896 gaim_gtk_prefs_checkbox(_("Show _Formatting Toolbar"), |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7305
diff
changeset
|
897 "/gaim/gtk/conversations/show_formatting_toolbar", vbox); |
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7305
diff
changeset
|
898 |
8015 | 899 gaim_gtk_prefs_checkbox(_("Show a_liases in tabs/titles"), |
900 "/core/conversations/use_alias_for_title", vbox); | |
901 | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
902 vbox = gaim_gtk_make_frame (ret, _("Tab Options")); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
903 |
7987 | 904 label = gaim_gtk_prefs_dropdown(vbox, _("_Tab Placement:"), GAIM_PREF_INT, |
905 "/gaim/gtk/conversations/tab_side", | |
906 _("Top"), GTK_POS_TOP, | |
907 _("Bottom"), GTK_POS_BOTTOM, | |
908 _("Left"), GTK_POS_LEFT, | |
909 _("Right"), GTK_POS_RIGHT, | |
910 NULL); | |
5667 | 911 |
912 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
913 gtk_size_group_add_widget(sg, label); | |
914 | |
7987 | 915 tabs_checkbox = gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
916 "/gaim/gtk/conversations/tabs", vbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
917 |
7987 | 918 same_checkbox = gaim_gtk_prefs_checkbox(_("Show IMs and chats in _same tabbed window"), |
6799 | 919 "/core/conversations/combine_chat_im", vbox); |
920 | |
7128 | 921 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { |
922 gtk_widget_set_sensitive(GTK_WIDGET(same_checkbox), FALSE); | |
923 } | |
924 | |
925 g_signal_connect(G_OBJECT(tabs_checkbox), "clicked", | |
926 G_CALLBACK(gaim_gtk_toggle_sensitive), same_checkbox); | |
927 | |
7987 | 928 close_checkbox = gaim_gtk_prefs_checkbox(_("Show _close button on tabs"), |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
929 "/gaim/gtk/conversations/close_on_tabs", |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
930 vbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
931 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
932 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
933 gtk_widget_set_sensitive(GTK_WIDGET(close_checkbox), FALSE); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
934 } |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
935 |
7128 | 936 g_signal_connect(G_OBJECT(tabs_checkbox), "clicked", |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
937 G_CALLBACK(gaim_gtk_toggle_sensitive), close_checkbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
938 |
7987 | 939 icons_checkbox = gaim_gtk_prefs_checkbox(_("Show status _icons on tabs"), |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
940 "/gaim/gtk/conversations/icons_on_tabs", |
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
941 vbox); |
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
942 |
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
943 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { |
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
944 gtk_widget_set_sensitive(GTK_WIDGET(icons_checkbox), FALSE); |
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
945 } |
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
946 |
7128 | 947 g_signal_connect(G_OBJECT(tabs_checkbox), "clicked", |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
948 G_CALLBACK(gaim_gtk_toggle_sensitive), icons_checkbox); |
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6384
diff
changeset
|
949 |
5440 | 950 gtk_widget_show_all(ret); |
951 | |
952 return ret; | |
953 } | |
954 | |
955 GtkWidget *im_page() { | |
956 GtkWidget *ret; | |
957 GtkWidget *vbox; | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
958 GtkWidget *widge; |
5440 | 959 GtkSizeGroup *sg; |
960 | |
961 ret = gtk_vbox_new(FALSE, 18); | |
962 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
963 | |
964 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
965 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
966 vbox = gaim_gtk_make_frame (ret, _("Window")); |
7987 | 967 widge = gaim_gtk_prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
968 "/gaim/gtk/conversations/im/button_type", | |
969 _("Pictures"), GAIM_BUTTON_IMAGE, | |
970 _("Text"), GAIM_BUTTON_TEXT, | |
971 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, | |
972 NULL); | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
973 |
5440 | 974 gtk_size_group_add_widget(sg, widge); |
975 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
7987 | 976 gaim_gtk_prefs_labeled_spin_button(vbox, _("New window _width:"), |
977 "/gaim/gtk/conversations/im/default_width", 25, 9999, sg); | |
978 gaim_gtk_prefs_labeled_spin_button(vbox, _("New window _height:"), | |
979 "/gaim/gtk/conversations/im/default_height", 25, 9999, sg); | |
980 gaim_gtk_prefs_labeled_spin_button(vbox, _("_Entry field height:"), | |
981 "/gaim/gtk/conversations/im/entry_height", 25, 9999, sg); | |
982 gaim_gtk_prefs_checkbox(_("_Raise window on events"), | |
983 "/gaim/gtk/conversations/im/raise_on_events", vbox); | |
984 gaim_gtk_prefs_checkbox(_("Hide window on _send"), | |
985 "/gaim/gtk/conversations/im/hide_on_send", vbox); | |
5440 | 986 gtk_widget_show (vbox); |
987 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
988 vbox = gaim_gtk_make_frame (ret, _("Buddy Icons")); |
7987 | 989 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), |
990 "/gaim/gtk/conversations/im/show_buddy_icons", vbox); | |
991 gaim_gtk_prefs_checkbox(_("Enable buddy icon a_nimation"), | |
992 "/gaim/gtk/conversations/im/animate_buddy_icons", vbox); | |
5440 | 993 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
994 vbox = gaim_gtk_make_frame (ret, _("Display")); |
7987 | 995 gaim_gtk_prefs_checkbox(_("Show _logins in window"), |
996 "/core/conversations/im/show_login", vbox); | |
5440 | 997 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
998 vbox = gaim_gtk_make_frame (ret, _("Typing Notification")); |
7987 | 999 gaim_gtk_prefs_checkbox(_("Notify buddies that you are _typing to them"), |
1000 "/core/conversations/im/send_typing", vbox); | |
5440 | 1001 |
1002 gtk_widget_show_all(ret); | |
1003 return ret; | |
1004 } | |
1005 | |
1006 GtkWidget *chat_page() { | |
1007 GtkWidget *ret; | |
1008 GtkWidget *vbox; | |
1009 GtkWidget *dd; | |
1010 GtkSizeGroup *sg; | |
1011 | |
1012 ret = gtk_vbox_new(FALSE, 18); | |
1013 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1014 | |
1015 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); | |
1016 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1017 vbox = gaim_gtk_make_frame (ret, _("Window")); |
7987 | 1018 dd = gaim_gtk_prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
1019 "/gaim/gtk/conversations/chat/button_type", | |
1020 _("Pictures"), GAIM_BUTTON_IMAGE, | |
1021 _("Text"), GAIM_BUTTON_TEXT, | |
1022 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, | |
1023 NULL); | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1024 |
5440 | 1025 gtk_size_group_add_widget(sg, dd); |
1026 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
7987 | 1027 gaim_gtk_prefs_labeled_spin_button(vbox, _("New window _width:"), |
1028 "/gaim/gtk/conversations/chat/default_width", 25, 9999, sg); | |
1029 gaim_gtk_prefs_labeled_spin_button(vbox, _("New window _height:"), | |
1030 "/gaim/gtk/conversations/chat/default_height", 25, 9999, sg); | |
1031 gaim_gtk_prefs_labeled_spin_button(vbox, _("_Entry field height:"), | |
1032 "/gaim/gtk/conversations/chat/entry_height", 25, 9999, sg); | |
1033 gaim_gtk_prefs_checkbox(_("_Raise window on events"), | |
1034 "/gaim/gtk/conversations/chat/raise_on_events", vbox); | |
5440 | 1035 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1036 vbox = gaim_gtk_make_frame (ret, _("Tab Completion")); |
7987 | 1037 gaim_gtk_prefs_checkbox(_("_Tab-complete nicks"), |
1038 "/gaim/gtk/conversations/chat/tab_completion", vbox); | |
1039 gaim_gtk_prefs_checkbox(_("_Old-style tab completion"), | |
1040 "/gaim/gtk/conversations/chat/old_tab_complete", vbox); | |
5440 | 1041 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1042 vbox = gaim_gtk_make_frame (ret, _("Display")); |
7987 | 1043 gaim_gtk_prefs_checkbox(_("_Show people joining in window"), |
1044 "/core/conversations/chat/show_join", vbox); | |
1045 gaim_gtk_prefs_checkbox(_("_Show people leaving in window"), | |
1046 "/core/conversations/chat/show_leave", vbox); | |
8152 | 1047 gaim_gtk_prefs_checkbox(_("Co_lorize screen names"), |
7987 | 1048 "/gaim/gtk/conversations/chat/color_nicks", vbox); |
5440 | 1049 |
1050 gtk_widget_show_all(ret); | |
1051 return ret; | |
1052 } | |
1053 | |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1054 static void network_ip_changed(GtkEntry *entry, gpointer data) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1055 { |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1056 gaim_prefs_set_string("/core/network/public_ip", gtk_entry_get_text(entry)); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1057 } |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1058 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1059 GtkWidget *network_page() { |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1060 GtkWidget *ret; |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1061 GtkWidget *vbox, *entry; |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1062 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1063 GtkSizeGroup *sg; |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1064 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1065 ret = gtk_vbox_new(FALSE, 18); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1066 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1067 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1068 vbox = gaim_gtk_make_frame (ret, _("IP Address")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1069 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1070 auto_ip_checkbox = gaim_gtk_prefs_checkbox(_("_Autodetect IP Address"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1071 "/core/network/auto_ip", vbox); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1072 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1073 table = gtk_table_new(2, 1, FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1074 gtk_container_set_border_width(GTK_CONTAINER(table), 5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1075 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1076 gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1077 gtk_container_add(GTK_CONTAINER(vbox), table); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1078 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1079 label = gtk_label_new_with_mnemonic(_("Public _IP:")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1080 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1081 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1082 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1083 entry = gtk_entry_new(); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1084 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1085 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1086 g_signal_connect(G_OBJECT(entry), "changed", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1087 G_CALLBACK(network_ip_changed), NULL); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1088 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1089 if (gaim_network_get_local_ip() != NULL) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1090 gtk_entry_set_text(GTK_ENTRY(entry), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1091 gaim_network_get_local_ip()); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1092 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1093 gaim_set_accessible_label (entry, label); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1094 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1095 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1096 if (gaim_prefs_get_bool("/core/network/auto_ip")) { |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1097 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1098 } |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1099 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1100 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1101 G_CALLBACK(gaim_gtk_toggle_sensitive), table); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1102 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1103 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1104 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1105 vbox = gaim_gtk_make_frame (ret, _("Ports")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1106 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1107 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1108 ports_checkbox = gaim_gtk_prefs_checkbox(_("_Manually specify range of ports to listen on"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1109 "/core/network/ports_range_use", vbox); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1110 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1111 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_Start Port:"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1112 "/core/network/ports_range_start", 0, 65535, sg); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1113 if (!gaim_prefs_get_bool("/core/network/ports_range_use")) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1114 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1115 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1116 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1117 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1118 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_End Port:"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1119 "/core/network/ports_range_end", 0, 65535, sg); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1120 if (!gaim_prefs_get_bool("/core/network/ports_range_use")) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1121 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1122 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1123 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1124 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1125 gtk_widget_show_all(ret); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1126 return ret; |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1127 } |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1128 |
6001 | 1129 static void |
1130 proxy_changed_cb(const char *name, GaimPrefType type, gpointer value, | |
7987 | 1131 gpointer data) |
6001 | 1132 { |
1133 GtkWidget *frame = data; | |
1134 const char *proxy = value; | |
1135 | |
6621 | 1136 if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) |
1137 gtk_widget_set_sensitive(frame, TRUE); | |
1138 else | |
1139 gtk_widget_set_sensitive(frame, FALSE); | |
6001 | 1140 } |
1141 | |
6006 | 1142 static void proxy_print_option(GtkEntry *entry, int entrynum) |
1143 { | |
1144 if (entrynum == PROXYHOST) | |
1145 gaim_prefs_set_string("/core/proxy/host", gtk_entry_get_text(entry)); | |
1146 else if (entrynum == PROXYPORT) | |
1147 gaim_prefs_set_int("/core/proxy/port", atoi(gtk_entry_get_text(entry))); | |
1148 else if (entrynum == PROXYUSER) | |
1149 gaim_prefs_set_string("/core/proxy/username", gtk_entry_get_text(entry)); | |
1150 else if (entrynum == PROXYPASS) | |
1151 gaim_prefs_set_string("/core/proxy/password", gtk_entry_get_text(entry)); | |
1152 } | |
1153 | |
5440 | 1154 GtkWidget *proxy_page() { |
1155 GtkWidget *ret; | |
1156 GtkWidget *vbox; | |
1157 GtkWidget *entry; | |
1158 GtkWidget *label; | |
1159 GtkWidget *hbox; | |
1160 GtkWidget *table; | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1161 GaimProxyInfo *proxy_info; |
5440 | 1162 |
1163 ret = gtk_vbox_new(FALSE, 18); | |
1164 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1165 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1166 vbox = gaim_gtk_make_frame (ret, _("Proxy Type")); |
7987 | 1167 gaim_gtk_prefs_dropdown(vbox, _("Proxy _type:"), GAIM_PREF_STRING, |
1168 "/core/proxy/type", | |
1169 _("No proxy"), "none", | |
1170 "SOCKS 4", "socks4", | |
1171 "SOCKS 5", "socks5", | |
1172 "HTTP", "http", | |
1173 _("Use Environmental Settings"), "envvar", | |
1174 NULL); | |
5440 | 1175 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1176 vbox = gaim_gtk_make_frame(ret, _("Proxy Server")); |
5440 | 1177 prefs_proxy_frame = vbox; |
1178 | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1179 proxy_info = gaim_global_proxy_get_info(); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1180 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1181 if (proxy_info == NULL || |
6621 | 1182 gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_NONE || |
1183 gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_USE_ENVVAR) { | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1184 |
6001 | 1185 gtk_widget_set_sensitive(GTK_WIDGET(prefs_proxy_frame), FALSE); |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1186 } |
6001 | 1187 proxy_pref_id = gaim_prefs_connect_callback("/core/proxy/type", |
1188 proxy_changed_cb, prefs_proxy_frame); | |
1189 | |
5440 | 1190 table = gtk_table_new(2, 4, FALSE); |
1191 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
1192 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
1193 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
1194 gtk_container_add(GTK_CONTAINER(vbox), table); | |
1195 | |
1196 | |
7797 | 1197 label = gtk_label_new_with_mnemonic(_("_Host:")); |
5440 | 1198 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
1199 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1200 | |
1201 entry = gtk_entry_new(); | |
1202 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1203 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
1204 g_signal_connect(G_OBJECT(entry), "changed", | |
1205 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1206 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1207 if (proxy_info != NULL && gaim_proxy_info_get_host(proxy_info)) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1208 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1209 gaim_proxy_info_get_host(proxy_info)); |
5440 | 1210 |
1211 hbox = gtk_hbox_new(TRUE, 5); | |
1212 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
8137 | 1213 gaim_set_accessible_label (entry, label); |
5440 | 1214 |
7870 | 1215 label = gtk_label_new_with_mnemonic(_("_Port:")); |
5440 | 1216 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
1217 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
1218 | |
1219 entry = gtk_entry_new(); | |
1220 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1221 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); | |
1222 g_signal_connect(G_OBJECT(entry), "changed", | |
1223 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
1224 | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1225 if (proxy_info != NULL && gaim_proxy_info_get_port(proxy_info) != 0) { |
5440 | 1226 char buf[128]; |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1227 g_snprintf(buf, sizeof(buf), "%d", |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1228 gaim_proxy_info_get_port(proxy_info)); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1229 |
5440 | 1230 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
1231 } | |
8137 | 1232 gaim_set_accessible_label (entry, label); |
5440 | 1233 |
7797 | 1234 label = gtk_label_new_with_mnemonic(_("_User:")); |
5440 | 1235 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
1236 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
1237 | |
1238 entry = gtk_entry_new(); | |
1239 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1240 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); | |
1241 g_signal_connect(G_OBJECT(entry), "changed", | |
1242 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1243 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1244 if (proxy_info != NULL && gaim_proxy_info_get_username(proxy_info) != NULL) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1245 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1246 gaim_proxy_info_get_username(proxy_info)); |
5440 | 1247 |
1248 hbox = gtk_hbox_new(TRUE, 5); | |
1249 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
8137 | 1250 gaim_set_accessible_label (entry, label); |
5440 | 1251 |
7797 | 1252 label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
5440 | 1253 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
1254 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
1255 | |
1256 entry = gtk_entry_new(); | |
1257 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1258 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); | |
1259 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
1260 g_signal_connect(G_OBJECT(entry), "changed", | |
1261 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1262 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1263 if (proxy_info != NULL && gaim_proxy_info_get_password(proxy_info) != NULL) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1264 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1265 gaim_proxy_info_get_password(proxy_info)); |
8137 | 1266 gaim_set_accessible_label (entry, label); |
5440 | 1267 |
1268 gtk_widget_show_all(ret); | |
1269 return ret; | |
1270 } | |
1271 | |
1272 #ifndef _WIN32 | |
1273 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
1274 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1275 | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1276 gaim_prefs_set_string("/gaim/gtk/browsers/command", program); |
5440 | 1277 |
1278 /* carry on normally */ | |
1279 return FALSE; | |
1280 } | |
1281 | |
5633 | 1282 static GList *get_available_browsers() |
5440 | 1283 { |
1284 struct browser { | |
1285 char *name; | |
1286 char *command; | |
1287 }; | |
1288 | |
1289 static struct browser possible_browsers[] = { | |
5633 | 1290 {N_("Opera"), "opera"}, |
1291 {N_("Netscape"), "netscape"}, | |
1292 {N_("Mozilla"), "mozilla"}, | |
6070 | 1293 {N_("Konqueror"), "kfmclient"}, |
7916 | 1294 {N_("Galeon"), "galeon"}, |
1295 {N_("Firebird"), "mozilla-firebird"} | |
5440 | 1296 }; |
7916 | 1297 static const int num_possible_browsers = 6; |
5440 | 1298 |
1299 GList *browsers = NULL; | |
1300 int i = 0; | |
5819 | 1301 char *browser_setting = (char *)gaim_prefs_get_string("/gaim/gtk/browsers/browser"); |
5440 | 1302 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1303 browsers = g_list_prepend(browsers, "custom"); |
5440 | 1304 browsers = g_list_prepend(browsers, _("Manual")); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1305 |
5440 | 1306 for (i = 0; i < num_possible_browsers; i++) { |
7108
6faeeecab0dc
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1307 if (gaim_program_is_valid(possible_browsers[i].command)) { |
5633 | 1308 browsers = g_list_prepend(browsers, |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1309 possible_browsers[i].command); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1310 browsers = g_list_prepend(browsers, _(possible_browsers[i].name)); |
5825 | 1311 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
5819 | 1312 browser_setting = NULL; |
5440 | 1313 } |
1314 } | |
1315 | |
5819 | 1316 if(browser_setting) |
1317 gaim_prefs_set_string("/gaim/gtk/browsers/browser", "custom"); | |
1318 | |
5440 | 1319 return browsers; |
1320 } | |
1321 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1322 static void |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1323 browser_changed_cb(const char *name, GaimPrefType type, gpointer value, |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1324 gpointer data) |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1325 { |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1326 GtkWidget *hbox = data; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1327 const char *browser = value; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1328 |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1329 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1330 } |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1331 |
5440 | 1332 GtkWidget *browser_page() { |
1333 GtkWidget *ret; | |
1334 GtkWidget *vbox; | |
1335 GtkWidget *hbox; | |
1336 GtkWidget *label; | |
8188
cd9ea20cd8ed
[gaim-migrate @ 8909]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
1337 GtkWidget *checkbox; |
6007 | 1338 GtkWidget *entry; |
5440 | 1339 GtkSizeGroup *sg; |
1340 GList *browsers = NULL; | |
1341 | |
1342 ret = gtk_vbox_new(FALSE, 18); | |
1343 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1344 | |
1345 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1346 vbox = gaim_gtk_make_frame (ret, _("Browser Selection")); |
5440 | 1347 |
1348 browsers = get_available_browsers(); | |
1349 if (browsers != NULL) { | |
7987 | 1350 label = gaim_gtk_prefs_dropdown_from_list(vbox,_("_Browser:"), GAIM_PREF_STRING, |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1351 "/gaim/gtk/browsers/browser", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1352 browsers); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1353 |
5440 | 1354 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
1355 gtk_size_group_add_widget(sg, label); | |
1356 } | |
1357 | |
1358 hbox = gtk_hbox_new(FALSE, 5); | |
1359 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
6031 | 1360 label = gtk_label_new_with_mnemonic(_("_Manual:\n(%s for URL)")); |
5440 | 1361 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
1362 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1363 gtk_size_group_add_widget(sg, label); | |
1364 | |
6007 | 1365 entry = gtk_entry_new(); |
1366 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1367 |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1368 if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) |
5440 | 1369 gtk_widget_set_sensitive(hbox, FALSE); |
6005 | 1370 browser_pref_id = gaim_prefs_connect_callback("/gaim/gtk/browsers/browser", |
1371 browser_changed_cb, hbox); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1372 |
6007 | 1373 gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); |
1374 | |
1375 gtk_entry_set_text(GTK_ENTRY(entry), | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1376 gaim_prefs_get_string("/gaim/gtk/browsers/command")); |
6007 | 1377 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1378 G_CALLBACK(manual_browser_set), NULL); |
8188
cd9ea20cd8ed
[gaim-migrate @ 8909]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
1379 gaim_set_accessible_label (entry, label); |
5440 | 1380 |
1381 if (browsers != NULL) { | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1382 vbox = gaim_gtk_make_frame (ret, _("Browser Options")); |
8188
cd9ea20cd8ed
[gaim-migrate @ 8909]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
1383 checkbox = gaim_gtk_prefs_checkbox(_("Open new _window by default"), |
cd9ea20cd8ed
[gaim-migrate @ 8909]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
1384 "/gaim/gtk/browsers/new_window", |
cd9ea20cd8ed
[gaim-migrate @ 8909]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
1385 vbox); |
5440 | 1386 } |
1387 | |
1388 gtk_widget_show_all(ret); | |
1389 return ret; | |
1390 } | |
1391 #endif /*_WIN32*/ | |
1392 | |
1393 GtkWidget *logging_page() { | |
1394 GtkWidget *ret; | |
1395 GtkWidget *vbox; | |
7431 | 1396 GList *names; |
5440 | 1397 ret = gtk_vbox_new(FALSE, 18); |
1398 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1399 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1400 vbox = gaim_gtk_make_frame (ret, _("Message Logs")); |
7431 | 1401 names = gaim_log_logger_get_options(); |
1402 | |
7987 | 1403 gaim_gtk_prefs_dropdown_from_list(vbox, _("Log _Format:"), GAIM_PREF_STRING, |
1404 "/core/logging/format", names); | |
1405 | |
1406 gaim_gtk_prefs_checkbox(_("_Log all instant messages"), | |
7562
b859cfb5f31a
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1407 "/core/logging/log_ims", vbox); |
7987 | 1408 gaim_gtk_prefs_checkbox(_("Log all c_hats"), |
7562
b859cfb5f31a
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1409 "/core/logging/log_chats", vbox); |
7553 | 1410 /* |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1411 vbox = gaim_gtk_make_frame (ret, _("System Logs")); |
7987 | 1412 gaim_gtk_prefs_checkbox(_("Log when buddies _sign on/sign off"), |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1413 "/gaim/gtk/logging/log_signon_signoff", vbox); |
7987 | 1414 gaim_gtk_prefs_checkbox(_("Log when buddies become _idle/un-idle"), |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1415 "/gaim/gtk/logging/log_idle_state", vbox); |
7987 | 1416 gaim_gtk_prefs_checkbox(_("Log when buddies go away/come _back"), |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1417 "/gaim/gtk/logging/log_away_state", vbox); |
7987 | 1418 gaim_gtk_prefs_checkbox(_("Log your _own signons/idleness/awayness"), |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1419 "/gaim/gtk/logging/log_own_states", vbox); |
7987 | 1420 gaim_gtk_prefs_checkbox(_("I_ndividual log file for each buddy's signons"), |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1421 "/gaim/gtk/logging/individual_logs", vbox); |
7553 | 1422 */ |
5440 | 1423 gtk_widget_show_all(ret); |
1424 return ret; | |
1425 } | |
1426 | |
1427 #ifndef _WIN32 | |
1428 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
1429 { | |
5684 | 1430 gaim_prefs_set_string("/gaim/gtk/sound/command", |
6007 | 1431 gtk_entry_get_text(GTK_ENTRY(entry))); |
5440 | 1432 return TRUE; |
1433 } | |
6005 | 1434 |
1435 static void | |
1436 sound_changed_cb(const char *name, GaimPrefType type, gpointer value, | |
1437 gpointer data) | |
1438 { | |
1439 GtkWidget *hbox = data; | |
1440 const char *method = value; | |
1441 | |
1442 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); | |
1443 } | |
5440 | 1444 #endif |
1445 | |
1446 GtkWidget *sound_page() { | |
1447 GtkWidget *ret; | |
1448 GtkWidget *vbox; | |
1449 GtkSizeGroup *sg; | |
1450 #ifndef _WIN32 | |
1451 GtkWidget *dd; | |
1452 GtkWidget *hbox; | |
1453 GtkWidget *label; | |
6007 | 1454 GtkWidget *entry; |
5684 | 1455 const char *cmd; |
5440 | 1456 #endif |
1457 | |
1458 ret = gtk_vbox_new(FALSE, 18); | |
1459 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1460 | |
1461 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1462 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1463 vbox = gaim_gtk_make_frame (ret, _("Sound Options")); |
7987 | 1464 gaim_gtk_prefs_checkbox(_("_No sounds when you log in"), |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1465 "/gaim/gtk/sound/silent_signon", vbox); |
7987 | 1466 gaim_gtk_prefs_checkbox(_("_Sounds while away"), |
5684 | 1467 "/core/sound/while_away", vbox); |
5440 | 1468 |
1469 #ifndef _WIN32 | |
6033 | 1470 vbox = gaim_gtk_make_frame (ret, _("Sound Method")); |
7987 | 1471 dd = gaim_gtk_prefs_dropdown(vbox, _("_Method:"), GAIM_PREF_STRING, |
1472 "/gaim/gtk/sound/method", | |
1473 _("Console beep"), "beep", | |
5440 | 1474 #ifdef USE_AO |
7987 | 1475 _("Automatic"), "automatic", |
1476 "ESD", "esd", | |
1477 "Arts", "arts", | |
5440 | 1478 #endif |
1479 #ifdef USE_NAS_AUDIO | |
7987 | 1480 "NAS", "nas", |
5440 | 1481 #endif |
7987 | 1482 _("Command"), "custom", |
1483 NULL); | |
5440 | 1484 gtk_size_group_add_widget(sg, dd); |
1485 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1486 | |
1487 hbox = gtk_hbox_new(FALSE, 5); | |
1488 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1489 | |
1490 hbox = gtk_hbox_new(FALSE, 5); | |
1491 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
6031 | 1492 label = gtk_label_new_with_mnemonic(_("Sound c_ommand:\n(%s for filename)")); |
5440 | 1493 gtk_size_group_add_widget(sg, label); |
1494 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1495 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1496 | |
6007 | 1497 entry = gtk_entry_new(); |
1498 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1499 | |
1500 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); | |
5684 | 1501 cmd = gaim_prefs_get_string("/gaim/gtk/sound/command"); |
5440 | 1502 if(cmd) |
6007 | 1503 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
1504 gtk_widget_set_size_request(entry, 75, -1); | |
1505 | |
1506 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5); | |
1507 g_signal_connect(G_OBJECT(entry), "changed", | |
5440 | 1508 G_CALLBACK(sound_cmd_yeah), NULL); |
6005 | 1509 |
1510 gtk_widget_set_sensitive(hbox, | |
1511 !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), | |
1512 "custom")); | |
1513 sound_pref_id = gaim_prefs_connect_callback("/gaim/gtk/sound/method", | |
1514 sound_changed_cb, hbox); | |
1515 | |
8141 | 1516 gaim_set_accessible_label (entry, label); |
5440 | 1517 #endif /* _WIN32 */ |
1518 gtk_widget_show_all(ret); | |
8137 | 1519 |
5440 | 1520 return ret; |
1521 } | |
1522 | |
6146
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1523 static void |
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1524 auto_resp_changed_cb(const char *name, GaimPrefType type, gpointer value, |
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1525 gpointer data) |
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1526 { |
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1527 GtkWidget *hbox = data; |
6196 | 1528 gboolean enabled = GPOINTER_TO_INT(value); |
6146
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1529 |
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1530 gtk_widget_set_sensitive(hbox, enabled); |
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1531 } |
aef34b0c175f
[gaim-migrate @ 6620]
Christian Hammond <chipx86@chipx86.com>
parents:
6142
diff
changeset
|
1532 |
5440 | 1533 GtkWidget *away_page() { |
1534 GtkWidget *ret; | |
1535 GtkWidget *vbox; | |
1536 GtkWidget *hbox; | |
1537 GtkWidget *label; | |
1538 GtkWidget *button; | |
1539 GtkWidget *select; | |
1540 GtkWidget *dd; | |
1541 GtkSizeGroup *sg; | |
1542 | |
1543 ret = gtk_vbox_new(FALSE, 18); | |
1544 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1545 | |
1546 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1547 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1548 vbox = gaim_gtk_make_frame (ret, _("Away")); |
7987 | 1549 gaim_gtk_prefs_checkbox(_("_Sending messages removes away status"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1550 "/core/conversations/away_back_on_send", vbox); |
7987 | 1551 gaim_gtk_prefs_checkbox(_("_Queue new messages when away"), |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
1552 "/gaim/gtk/away/queue_messages", vbox); |
5440 | 1553 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1554 vbox = gaim_gtk_make_frame (ret, _("Auto-response")); |
5440 | 1555 hbox = gtk_hbox_new(FALSE, 0); |
1556 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
7987 | 1557 gaim_gtk_prefs_labeled_spin_button(hbox, _("Seconds before _resending:"), |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1558 "/core/away/auto_response/sec_before_resend", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1559 1, 24 * 60 * 60, sg); |
7987 | 1560 gaim_gtk_prefs_checkbox(_("_Send auto-response"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1561 "/core/away/auto_response/enabled", vbox); |
7987 | 1562 gaim_gtk_prefs_checkbox(_("_Only send auto-response when idle"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1563 "/core/away/auto_response/idle_only", vbox); |
7987 | 1564 gaim_gtk_prefs_checkbox(_("Send auto-response in _active conversations"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1565 "/core/away/auto_response/in_active_conv", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1566 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1567 if (!gaim_prefs_get_bool("/core/away/auto_response/enabled")) |
5440 | 1568 gtk_widget_set_sensitive(hbox, FALSE); |
1569 | |
6142 | 1570 auto_resp_pref_id = gaim_prefs_connect_callback("/core/away/auto_response/enabled", |
1571 auto_resp_changed_cb, hbox); | |
1572 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1573 vbox = gaim_gtk_make_frame (ret, _("Idle")); |
7987 | 1574 dd = gaim_gtk_prefs_dropdown(vbox, _("Idle _time reporting:"), |
1575 GAIM_PREF_STRING, "/gaim/gtk/idle/reporting_method", | |
1576 _("None"), "none", | |
1577 _("Gaim usage"), "gaim", | |
5440 | 1578 #ifdef USE_SCREENSAVER |
1579 #ifndef _WIN32 | |
7987 | 1580 _("X usage"), "system", |
5440 | 1581 #else |
7987 | 1582 _("Windows usage"), "system", |
5440 | 1583 #endif |
1584 #endif | |
7987 | 1585 NULL); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1586 |
5440 | 1587 gtk_size_group_add_widget(sg, dd); |
1588 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1589 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1590 vbox = gaim_gtk_make_frame (ret, _("Auto-away")); |
7987 | 1591 button = gaim_gtk_prefs_checkbox(_("Set away _when idle"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1592 "/core/away/away_when_idle", vbox); |
7987 | 1593 select = gaim_gtk_prefs_labeled_spin_button(vbox, |
1594 _("_Minutes before setting away:"), "/core/away/mins_before_away", | |
1595 1, 24 * 60, sg); | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1596 |
5440 | 1597 g_signal_connect(G_OBJECT(button), "clicked", |
1598 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
1599 | |
1600 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); | |
1601 gtk_size_group_add_widget(sg, label); | |
1602 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1603 hbox = gtk_hbox_new(FALSE, 0); | |
1604 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1605 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1606 prefs_away_menu = gtk_option_menu_new(); | |
1607 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1608 |
5440 | 1609 g_signal_connect(G_OBJECT(button), "clicked", |
1610 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); | |
1611 default_away_menu_init(prefs_away_menu); | |
1612 gtk_widget_show(prefs_away_menu); | |
1613 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
1614 | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1615 if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1616 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1617 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1618 } |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1619 |
8137 | 1620 gaim_set_accessible_label (prefs_away_menu, label); |
1621 | |
5440 | 1622 gtk_widget_show_all(ret); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1623 |
5440 | 1624 return ret; |
1625 } | |
1626 | |
8170 | 1627 static GtkWidget * |
1628 protocol_page() { | |
1629 GtkWidget *ret; | |
1630 | |
1631 ret = gtk_label_new(NULL); | |
1632 gtk_widget_show(ret); | |
1633 | |
1634 return ret; | |
1635 } | |
1636 | |
1637 static gboolean | |
1638 protocol_pref_entry_cb(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
1639 char *pref = data; | |
1640 | |
1641 gaim_prefs_set_string(pref, gtk_entry_get_text(GTK_ENTRY(entry))); | |
1642 | |
1643 return FALSE; | |
1644 } | |
1645 | |
1646 static GtkWidget * | |
1647 protocol_pref_page(GaimPluginProtocolInfo *prpl_info) { | |
1648 GtkWidget *ret, *parent, *frame, *hbox, *label, *misc; | |
1649 GtkSizeGroup *sg; | |
1650 GList *pp = NULL; | |
1651 | |
1652 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1653 | |
1654 ret = gtk_vbox_new(FALSE, 18); | |
1655 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1656 gtk_widget_show(ret); | |
1657 | |
1658 parent = ret; | |
1659 | |
1660 for(pp = prpl_info->protocol_prefs; pp != NULL; pp = pp->next) { | |
1661 struct proto_pref *pref = pp->data; | |
1662 | |
1663 if(pref->key != NULL) { | |
1664 switch(gaim_prefs_get_type(pref->key)) { | |
1665 case GAIM_PREF_BOOLEAN: | |
1666 misc = gaim_gtk_prefs_checkbox(pref->label, | |
1667 pref->key, | |
1668 parent); | |
1669 break; | |
1670 case GAIM_PREF_INT: | |
1671 misc = gaim_gtk_prefs_labeled_spin_button(parent, | |
1672 pref->label, | |
1673 pref->key, | |
1674 pref->min, | |
1675 pref->max, | |
1676 sg); | |
1677 break; | |
1678 case GAIM_PREF_STRING: | |
1679 hbox = gtk_hbox_new(FALSE, 6); | |
1680 gtk_widget_show(hbox); | |
1681 gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0); | |
1682 | |
1683 label = gtk_label_new_with_mnemonic(pref->label); | |
1684 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1685 gtk_size_group_add_widget(sg, label); | |
1686 gtk_widget_show(label); | |
1687 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1688 | |
1689 misc = gtk_entry_new(); | |
1690 gtk_entry_set_text(GTK_ENTRY(misc), | |
1691 gaim_prefs_get_string(pref->key)); | |
1692 g_signal_connect(G_OBJECT(misc), "focus-out-event", | |
1693 G_CALLBACK(protocol_pref_entry_cb), | |
1694 (gpointer)pref->key); | |
1695 gtk_label_set_mnemonic_widget(GTK_LABEL(label), misc); | |
1696 gtk_widget_show(misc); | |
1697 gtk_box_pack_start(GTK_BOX(hbox), misc, FALSE, FALSE, 0); | |
1698 | |
1699 break; | |
1700 case GAIM_PREF_NONE: /* XXX No use for this, if you want a | |
1701 frame, set key to NULL */ | |
1702 case GAIM_PREF_STRING_LIST: /*XXX No one should need this */ | |
1703 default: | |
1704 break; | |
1705 } | |
1706 } else { | |
1707 frame = gaim_gtk_make_frame(ret, pref->label); | |
1708 gtk_widget_show(frame); | |
1709 | |
1710 parent = frame; | |
1711 } | |
1712 } | |
1713 | |
1714 return ret; | |
1715 } | |
1716 | |
5440 | 1717 static GtkWidget *plugin_description=NULL, *plugin_details=NULL; |
1718 | |
1719 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
1720 { | |
1721 gchar *buf, *pname, *perr, *pdesc, *pauth, *pweb; | |
1722 GtkTreeIter iter; | |
1723 GValue val = { 0, }; | |
1724 GaimPlugin *plug; | |
1725 | |
1726 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1727 return; | |
8104 | 1728 gtk_tree_model_get_value (model, &iter, 3, &val); |
5440 | 1729 plug = g_value_get_pointer(&val); |
1730 | |
1731 pname = g_markup_escape_text(_(plug->info->name), -1); | |
1732 pdesc = g_markup_escape_text(_(plug->info->description), -1); | |
1733 pauth = g_markup_escape_text(_(plug->info->author), -1); | |
1734 pweb = g_markup_escape_text(_(plug->info->homepage), -1); | |
1735 if (plug->error != NULL) { | |
1736 perr = g_markup_escape_text(_(plug->error), -1); | |
1737 buf = g_strdup_printf( | |
1738 "<span size=\"larger\">%s %s</span>\n\n" | |
1739 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1740 "%s", | |
1741 pname, plug->info->version, perr, pdesc); | |
1742 g_free(perr); | |
1743 } | |
1744 else { | |
1745 buf = g_strdup_printf( | |
1746 "<span size=\"larger\">%s %s</span>\n\n%s", | |
1747 pname, plug->info->version, pdesc); | |
1748 } | |
1749 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1750 g_free(buf); | |
1751 | |
1752 buf = g_strdup_printf( | |
1753 #ifndef _WIN32 | |
1754 _("<span size=\"larger\">%s %s</span>\n\n" | |
1755 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
1756 "<span weight=\"bold\">Web site:</span>\t\t%s\n" | |
1757 "<span weight=\"bold\">File name:</span>\t%s"), | |
1758 #else | |
1759 _("<span size=\"larger\">%s %s</span>\n\n" | |
1760 "<span weight=\"bold\">Written by:</span> %s\n" | |
1761 "<span weight=\"bold\">URL:</span> %s\n" | |
1762 "<span weight=\"bold\">File name:</span> %s"), | |
1763 #endif | |
1764 pname, plug->info->version, pauth, pweb, plug->path); | |
1765 | |
1766 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
1767 g_value_unset(&val); | |
1768 g_free(buf); | |
1769 g_free(pname); | |
1770 g_free(pdesc); | |
1771 g_free(pauth); | |
1772 g_free(pweb); | |
1773 } | |
1774 | |
1775 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1776 { | |
1777 GtkTreeModel *model = (GtkTreeModel *)data; | |
1778 GtkTreeIter iter; | |
1779 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1780 GaimPlugin *plug; | |
1781 gchar buf[1024]; | |
6040 | 1782 gchar *name = NULL, *description = NULL; |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1783 |
5440 | 1784 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1785 gdk_window_set_cursor(prefs->window, wait); | |
1786 gdk_cursor_unref(wait); | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1787 |
5440 | 1788 gtk_tree_model_get_iter (model, &iter, path); |
8104 | 1789 gtk_tree_model_get (model, &iter, 3, &plug, -1); |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1790 |
5440 | 1791 if (!gaim_plugin_is_loaded(plug)) { |
1792 gaim_plugin_load(plug); | |
1793 | |
1794 /* | |
1795 * NOTE: This is basically the same check as before | |
1796 * (plug->type == plugin), but now there aren't plugin types. | |
1797 * Not yet, anyway. I want to do a V2 of the plugin API. | |
1798 * The thing is, we should have a flag specifying the UI type, | |
1799 * or just whether it's a general plugin or a UI-specific | |
1800 * plugin. We should only load this if it's UI-specific. | |
1801 * | |
1802 * -- ChipX86 | |
1803 */ | |
1804 if (GAIM_IS_GTK_PLUGIN(plug)) | |
1805 { | |
1806 GtkWidget *config_frame; | |
1807 GaimGtkPluginUiInfo *ui_info; | |
1808 | |
1809 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1810 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
1811 | |
1812 if (config_frame != NULL) { | |
1813 ui_info->iter = g_new0(GtkTreeIter, 1); | |
1814 prefs_notebook_add_page(_(plug->info->name), NULL, | |
1815 config_frame, ui_info->iter, | |
1816 &plugin_iter, notebook_page++); | |
1817 | |
1818 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), | |
1819 &plugin_iter) == 1) { | |
1820 | |
1821 /* Expand the tree for the first plugin added */ | |
1822 GtkTreePath *path2; | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1823 |
5440 | 1824 path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), |
1825 &plugin_iter); | |
1826 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), | |
1827 path2, TRUE); | |
1828 gtk_tree_path_free(path2); | |
1829 } | |
1830 } | |
1831 } | |
1832 } | |
1833 else { | |
1834 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
1835 GaimGtkPluginUiInfo *ui_info; | |
1836 | |
1837 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1838 | |
1839 if (ui_info != NULL && ui_info->iter != NULL) { | |
1840 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), ui_info->iter); | |
1841 g_free(ui_info->iter); | |
1842 ui_info->iter = NULL; | |
1843 } | |
1844 } | |
1845 | |
1846 gaim_plugin_unload(plug); | |
1847 } | |
1848 | |
1849 gdk_window_set_cursor(prefs->window, NULL); | |
1850 | |
6040 | 1851 name = g_markup_escape_text(_(plug->info->name), -1); |
1852 description = g_markup_escape_text(_(plug->info->description), -1); | |
5440 | 1853 if (plug->error != NULL) { |
6040 | 1854 gchar *error = g_markup_escape_text(plug->error, -1); |
5440 | 1855 g_snprintf(buf, sizeof(buf), |
1856 "<span size=\"larger\">%s %s</span>\n\n" | |
1857 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1858 "%s", | |
6040 | 1859 name, plug->info->version, error, description); |
1860 g_free(error); | |
1861 } else { | |
5440 | 1862 g_snprintf(buf, sizeof(buf), |
1863 "<span size=\"larger\">%s %s</span>\n\n%s", | |
6040 | 1864 name, plug->info->version, description); |
5440 | 1865 } |
6040 | 1866 g_free(name); |
1867 g_free(description); | |
5440 | 1868 |
1869 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1870 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, | |
1871 gaim_plugin_is_loaded(plug), -1); | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1872 |
5440 | 1873 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1874 gtk_tree_path_free(path); | |
5981
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1875 |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1876 gaim_gtk_plugins_save(); |
5440 | 1877 } |
1878 | |
1879 static void | |
1880 update_plugin_list(void *data) | |
1881 { | |
1882 GtkListStore *ls = GTK_LIST_STORE(data); | |
1883 GtkTreeIter iter; | |
1884 GList *probes; | |
1885 GaimPlugin *plug; | |
1886 | |
1887 gtk_list_store_clear(ls); | |
1888 | |
1889 for (probes = gaim_plugins_get_all(); | |
1890 probes != NULL; | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1891 probes = probes->next) |
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1892 { |
5440 | 1893 plug = probes->data; |
1894 | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1895 if (plug->info->type != GAIM_PLUGIN_STANDARD || |
6930
31c45d99e1a8
[gaim-migrate @ 7477]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
1896 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE)) |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1897 { |
5440 | 1898 continue; |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1899 } |
5440 | 1900 |
1901 gtk_list_store_append (ls, &iter); | |
1902 gtk_list_store_set(ls, &iter, | |
1903 0, gaim_plugin_is_loaded(plug), | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1904 1, plug->info->name ? _(plug->info->name) : plug->path, |
8162 | 1905 2, _(plug->info->summary), |
8104 | 1906 3, plug, -1); |
5440 | 1907 } |
1908 } | |
1909 | |
1910 static GtkWidget *plugin_page () | |
1911 { | |
1912 GtkWidget *ret; | |
1913 GtkWidget *sw, *vp; | |
1914 GtkWidget *event_view; | |
1915 GtkListStore *ls; | |
1916 GtkCellRenderer *rend, *rendt; | |
1917 GtkTreeViewColumn *col; | |
1918 GtkTreeSelection *sel; | |
1919 GtkTreePath *path; | |
1920 GtkWidget *nb; | |
1921 | |
1922 ret = gtk_vbox_new(FALSE, 18); | |
1923 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1924 | |
1925 sw = gtk_scrolled_window_new(NULL,NULL); | |
8104 | 1926 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
5440 | 1927 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1928 | |
1929 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1930 | |
8104 | 1931 ls = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); |
7939 | 1932 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), |
1933 1, GTK_SORT_ASCENDING); | |
5440 | 1934 |
1935 update_plugin_list(ls); | |
1936 | |
1937 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
1938 | |
1939 rend = gtk_cell_renderer_toggle_new(); | |
1940 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1941 | |
1942 col = gtk_tree_view_column_new_with_attributes (_("Load"), | |
1943 rend, | |
1944 "active", 0, | |
1945 NULL); | |
1946 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1947 | |
1948 rendt = gtk_cell_renderer_text_new(); | |
1949 col = gtk_tree_view_column_new_with_attributes (_("Name"), | |
1950 rendt, | |
1951 "text", 1, | |
1952 NULL); | |
1953 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
8104 | 1954 |
1955 rendt = gtk_cell_renderer_text_new(); | |
1956 col = gtk_tree_view_column_new_with_attributes(_("Summary"), | |
1957 rendt, | |
1958 "text", 2, | |
1959 NULL); | |
1960 gtk_tree_view_append_column(GTK_TREE_VIEW(event_view), col); | |
1961 | |
5440 | 1962 g_object_unref(G_OBJECT(ls)); |
1963 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1964 | |
1965 | |
1966 nb = gtk_notebook_new(); | |
1967 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1968 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1969 | |
1970 /* Description */ | |
1971 sw = gtk_scrolled_window_new(NULL, NULL); | |
1972 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1973 plugin_description = gtk_label_new(NULL); | |
1974 | |
1975 vp = gtk_viewport_new(NULL, NULL); | |
1976 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
1977 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
1978 | |
1979 gtk_container_add(GTK_CONTAINER(vp), plugin_description); | |
1980 gtk_container_add(GTK_CONTAINER(sw), vp); | |
1981 | |
1982 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); | |
1983 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
1984 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); | |
1985 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1986 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1987 | |
1988 /* Details */ | |
1989 sw = gtk_scrolled_window_new(NULL, NULL); | |
1990 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1991 plugin_details = gtk_label_new(NULL); | |
1992 | |
1993 vp = gtk_viewport_new(NULL, NULL); | |
1994 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
1995 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
1996 | |
1997 gtk_container_add(GTK_CONTAINER(vp), plugin_details); | |
1998 gtk_container_add(GTK_CONTAINER(sw), vp); | |
1999 | |
2000 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); | |
2001 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
2002 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); | |
2003 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
2004 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
2005 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
2006 | |
2007 g_signal_connect (G_OBJECT (sel), "changed", | |
2008 G_CALLBACK (prefs_plugin_sel), | |
2009 NULL); | |
2010 g_signal_connect (G_OBJECT(rend), "toggled", | |
2011 G_CALLBACK(plugin_load), ls); | |
2012 | |
2013 path = gtk_tree_path_new_first(); | |
2014 gtk_tree_selection_select_path(sel, path); | |
2015 gtk_tree_path_free(path); | |
2016 | |
2017 gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); | |
2018 | |
2019 gtk_widget_show_all(ret); | |
2020 return ret; | |
2021 } | |
2022 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2023 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2024 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
5440 | 2025 { |
2026 GtkTreeModel *model = (GtkTreeModel *)data; | |
2027 GtkTreeIter iter; | |
2028 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2029 const char *pref; |
5440 | 2030 |
2031 gtk_tree_model_get_iter (model, &iter, path); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2032 gtk_tree_model_get (model, &iter, |
5612 | 2033 2, &pref, |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2034 -1); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2035 |
5684 | 2036 gaim_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2037 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2038 gtk_list_store_set(GTK_LIST_STORE (model), &iter, |
5612 | 2039 0, !gtk_cell_renderer_toggle_get_active(cell), |
2040 -1); | |
5440 | 2041 |
2042 gtk_tree_path_free(path); | |
2043 } | |
2044 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2045 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2046 test_sound(GtkWidget *button, gpointer i_am_NULL) |
5440 | 2047 { |
5684 | 2048 char *pref; |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2049 gboolean temp_value1, temp_value2; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2050 |
5684 | 2051 pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", |
2052 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2053 |
5821 | 2054 temp_value1 = gaim_prefs_get_bool("/core/sound/while_away"); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2055 temp_value2 = gaim_prefs_get_bool(pref); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2056 |
5821 | 2057 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", TRUE); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2058 if (!temp_value2) gaim_prefs_set_bool(pref, TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2059 |
5440 | 2060 gaim_sound_play_event(sound_row_sel); |
2061 | |
5821 | 2062 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", FALSE); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2063 if (!temp_value2) gaim_prefs_set_bool(pref, FALSE); |
5684 | 2064 |
2065 g_free(pref); | |
5440 | 2066 } |
2067 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2068 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2069 reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
5440 | 2070 { |
5684 | 2071 char *pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
2072 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
2073 | |
5440 | 2074 /* This just resets a sound file back to default */ |
5684 | 2075 gaim_prefs_set_string(pref, ""); |
2076 g_free(pref); | |
5440 | 2077 |
2078 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); | |
2079 } | |
2080 | |
2081 void close_sounddialog(GtkWidget *w, GtkWidget *w2) | |
2082 { | |
2083 | |
2084 GtkWidget *dest; | |
2085 | |
2086 if (!GTK_IS_WIDGET(w2)) | |
2087 dest = w; | |
2088 else | |
2089 dest = w2; | |
2090 | |
2091 sounddialog = NULL; | |
2092 | |
2093 gtk_widget_destroy(dest); | |
2094 } | |
2095 | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2096 void do_select_sound(GtkWidget *w, gpointer data) |
5440 | 2097 { |
2098 const char *file; | |
5684 | 2099 char *pref; |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2100 int snd; |
5440 | 2101 |
2102 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2103 snd = GPOINTER_TO_INT(data); |
5440 | 2104 |
2105 /* If they type in a directory, change there */ | |
5966 | 2106 if (gaim_gtk_check_if_dir(file, GTK_FILE_SELECTION(sounddialog))) |
5440 | 2107 return; |
2108 | |
2109 /* Set it -- and forget it */ | |
5684 | 2110 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
2111 gaim_gtk_sound_get_event_option(snd)); | |
2112 gaim_prefs_set_string(pref, file); | |
2113 g_free(pref); | |
5440 | 2114 |
2115 /* Set our text entry */ | |
2116 gtk_entry_set_text(GTK_ENTRY(sound_entry), file); | |
2117 | |
2118 /* Close the window! It's getting cold in here! */ | |
2119 close_sounddialog(NULL, sounddialog); | |
2120 | |
2121 if (last_sound_dir) | |
2122 g_free(last_sound_dir); | |
2123 last_sound_dir = g_path_get_dirname(file); | |
2124 } | |
2125 | |
2126 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) | |
2127 { | |
2128 char *buf = g_malloc(BUF_LEN); | |
2129 | |
2130 if (!sounddialog) { | |
2131 sounddialog = gtk_file_selection_new(_("Sound Selection")); | |
2132 | |
2133 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
2134 | |
2135 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); | |
2136 | |
2137 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
2138 | |
2139 g_signal_connect(G_OBJECT(sounddialog), "destroy", | |
2140 G_CALLBACK(close_sounddialog), sounddialog); | |
2141 | |
2142 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
2143 "clicked", | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2144 G_CALLBACK(do_select_sound), GINT_TO_POINTER(sound_row_sel)); |
5440 | 2145 |
2146 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), | |
2147 "clicked", | |
2148 G_CALLBACK(close_sounddialog), sounddialog); | |
2149 } | |
2150 | |
2151 g_free(buf); | |
2152 gtk_widget_show(sounddialog); | |
2153 gdk_window_raise(sounddialog->window); | |
2154 } | |
2155 | |
2156 | |
2157 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
2158 GtkTreeIter iter; | |
2159 GValue val = { 0, }; | |
5684 | 2160 const char *file; |
2161 char *pref; | |
5440 | 2162 |
2163 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
2164 return; | |
5612 | 2165 gtk_tree_model_get_value (model, &iter, 3, &val); |
5440 | 2166 sound_row_sel = g_value_get_uint(&val); |
5684 | 2167 |
2168 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
2169 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
2170 file = gaim_prefs_get_string(pref); | |
2171 g_free(pref); | |
5440 | 2172 if (sound_entry) |
6088 | 2173 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); |
5440 | 2174 g_value_unset (&val); |
2175 if (sounddialog) | |
2176 gtk_widget_destroy(sounddialog); | |
2177 } | |
2178 | |
2179 GtkWidget *sound_events_page() { | |
2180 | |
2181 GtkWidget *ret; | |
2182 GtkWidget *sw; | |
2183 GtkWidget *button, *hbox; | |
2184 GtkTreeIter iter; | |
2185 GtkWidget *event_view; | |
2186 GtkListStore *event_store; | |
2187 GtkCellRenderer *rend; | |
2188 GtkTreeViewColumn *col; | |
2189 GtkTreeSelection *sel; | |
2190 GtkTreePath *path; | |
2191 int j; | |
5684 | 2192 const char *file; |
2193 char *pref; | |
5440 | 2194 |
2195 ret = gtk_vbox_new(FALSE, 18); | |
2196 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2197 | |
2198 sw = gtk_scrolled_window_new(NULL,NULL); | |
2199 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
2200 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
2201 | |
2202 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
5612 | 2203 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
5440 | 2204 |
2205 for (j=0; j < GAIM_NUM_SOUNDS; j++) { | |
5684 | 2206 char *pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", |
2207 gaim_gtk_sound_get_event_option(j)); | |
2208 const char *label = gaim_gtk_sound_get_event_label(j); | |
2209 | |
5870 | 2210 if (label == NULL) { |
2211 g_free(pref); | |
5440 | 2212 continue; |
5870 | 2213 } |
5440 | 2214 |
2215 gtk_list_store_append (event_store, &iter); | |
2216 gtk_list_store_set(event_store, &iter, | |
5612 | 2217 0, gaim_prefs_get_bool(pref), |
5684 | 2218 1, _(label), |
5612 | 2219 2, pref, |
2220 3, j, | |
2221 -1); | |
5684 | 2222 g_free(pref); |
5440 | 2223 } |
2224 | |
2225 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
2226 | |
2227 rend = gtk_cell_renderer_toggle_new(); | |
2228 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
2229 g_signal_connect (G_OBJECT (sel), "changed", | |
2230 G_CALLBACK (prefs_sound_sel), | |
2231 NULL); | |
2232 g_signal_connect (G_OBJECT(rend), "toggled", | |
2233 G_CALLBACK(event_toggled), event_store); | |
2234 path = gtk_tree_path_new_first(); | |
2235 gtk_tree_selection_select_path(sel, path); | |
2236 gtk_tree_path_free(path); | |
2237 | |
2238 col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
2239 rend, | |
2240 "active", 0, | |
2241 NULL); | |
2242 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2243 | |
2244 rend = gtk_cell_renderer_text_new(); | |
2245 col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
2246 rend, | |
2247 "text", 1, | |
2248 NULL); | |
2249 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2250 g_object_unref(G_OBJECT(event_store)); | |
2251 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
2252 | |
2253 hbox = gtk_hbox_new(FALSE, 6); | |
2254 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
2255 sound_entry = gtk_entry_new(); | |
5684 | 2256 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
2257 gaim_gtk_sound_get_event_option(0)); | |
2258 file = gaim_prefs_get_string(pref); | |
2259 g_free(pref); | |
6088 | 2260 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); |
5440 | 2261 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
2262 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
2263 | |
2264 button = gtk_button_new_with_label(_("Test")); | |
2265 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
2266 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
2267 | |
2268 button = gtk_button_new_with_label(_("Reset")); | |
2269 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
2270 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
2271 | |
2272 button = gtk_button_new_with_label(_("Choose...")); | |
2273 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); | |
2274 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
2275 | |
2276 gtk_widget_show_all (ret); | |
2277 | |
2278 return ret; | |
2279 } | |
2280 | |
6979 | 2281 static void away_message_sel_cb(GtkTreeSelection *sel, GtkTreeModel *model) |
5440 | 2282 { |
2283 GtkTreeIter iter; | |
2284 GValue val = { 0, }; | |
2285 gchar buffer[BUF_LONG]; | |
2286 char *tmp; | |
2287 struct away_message *am; | |
2288 | |
2289 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
2290 return; | |
2291 gtk_tree_model_get_value (model, &iter, 1, &val); | |
2292 am = g_value_get_pointer(&val); | |
2293 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
2294 strncpy(buffer, am->message, BUF_LONG); | |
2295 tmp = stylize(buffer, BUF_LONG); | |
6982 | 2296 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, GTK_IMHTML_NO_TITLE | |
5440 | 2297 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
6982 | 2298 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", GTK_IMHTML_NO_TITLE | |
5440 | 2299 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2300 g_free(tmp); | |
2301 g_value_unset (&val); | |
2302 | |
2303 } | |
2304 | |
6979 | 2305 static gboolean away_message_click_cb(GtkWidget *tv, GdkEventButton *event, gpointer null) |
2306 { | |
2307 /* Only respond to double click on button 1 */ | |
2308 if ((event->button != 1) || (event->type != GDK_2BUTTON_PRESS)) | |
2309 return FALSE; | |
2310 | |
2311 /* Show the edit away message dialog */ | |
2312 create_away_mess(NULL, tv); | |
2313 | |
2314 return FALSE; | |
2315 } | |
2316 | |
5440 | 2317 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
6016 | 2318 struct away_message *am; |
5440 | 2319 GtkTreeIter iter; |
2320 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
2321 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); | |
2322 GValue val = { 0, }; | |
2323 | |
2324 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
2325 return; | |
2326 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); | |
2327 am = g_value_get_pointer (&val); | |
2328 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
2329 rem_away_mess(NULL, am); | |
2330 } | |
2331 | |
2332 GtkWidget *away_message_page() { | |
2333 GtkWidget *ret; | |
2334 GtkWidget *hbox; | |
2335 GtkWidget *button; | |
2336 GtkWidget *sw; | |
2337 GtkTreeIter iter; | |
2338 GtkWidget *event_view; | |
2339 GtkCellRenderer *rend; | |
2340 GtkTreeViewColumn *col; | |
2341 GtkTreeSelection *sel; | |
2342 GSList *awy = away_messages; | |
2343 struct away_message *a; | |
2344 GtkSizeGroup *sg; | |
2345 | |
2346 ret = gtk_vbox_new(FALSE, 18); | |
2347 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2348 | |
2349 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
2350 | |
2351 sw = gtk_scrolled_window_new(NULL,NULL); | |
7931 | 2352 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
7929 | 2353 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
5440 | 2354 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
2355 | |
7940 | 2356 prefs_away_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); |
5440 | 2357 while (awy) { |
2358 a = (struct away_message *)awy->data; | |
2359 gtk_list_store_append (prefs_away_store, &iter); | |
2360 gtk_list_store_set(prefs_away_store, &iter, | |
2361 0, a->name, | |
2362 1, a, -1); | |
2363 awy = awy->next; | |
2364 } | |
7939 | 2365 event_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(prefs_away_store)); |
5440 | 2366 |
2367 rend = gtk_cell_renderer_text_new(); | |
2368 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
2369 rend, | |
2370 "text", 0, | |
2371 NULL); | |
2372 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2373 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
2374 gtk_widget_show(event_view); | |
7931 | 2375 gtk_container_add(GTK_CONTAINER(sw), event_view); |
5440 | 2376 |
7929 | 2377 sw = gtk_scrolled_window_new(NULL, NULL); |
7931 | 2378 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
7929 | 2379 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), |
5440 | 2380 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
7929 | 2381 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
2382 | |
2383 away_text = gtk_imhtml_new(NULL, NULL); | |
7931 | 2384 gtk_container_add(GTK_CONTAINER(sw), away_text); |
2385 | |
5440 | 2386 gaim_setup_imhtml(away_text); |
2387 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
6979 | 2388 g_signal_connect(G_OBJECT(sel), "changed", |
2389 G_CALLBACK(away_message_sel_cb), NULL); | |
2390 g_signal_connect(G_OBJECT(event_view), "button-press-event", | |
2391 G_CALLBACK(away_message_click_cb), NULL); | |
5440 | 2392 hbox = gtk_hbox_new(TRUE, 5); |
2393 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
2394 button = gtk_button_new_from_stock (GTK_STOCK_ADD); | |
2395 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2396 gtk_size_group_add_widget(sg, button); | |
2397 g_signal_connect(G_OBJECT(button), "clicked", | |
2398 G_CALLBACK(create_away_mess), NULL); | |
2399 | |
2400 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); | |
2401 gtk_size_group_add_widget(sg, button); | |
2402 g_signal_connect(G_OBJECT(button), "clicked", | |
2403 G_CALLBACK(remove_away_message), event_view); | |
2404 | |
2405 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2406 | |
2407 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); | |
2408 gtk_size_group_add_widget(sg, button); | |
2409 g_signal_connect(G_OBJECT(button), "clicked", | |
2410 G_CALLBACK(create_away_mess), event_view); | |
2411 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2412 | |
2413 gtk_widget_show_all(ret); | |
2414 return ret; | |
2415 } | |
2416 | |
2417 GtkTreeIter *prefs_notebook_add_page(const char *text, | |
2418 GdkPixbuf *pixbuf, | |
2419 GtkWidget *page, | |
2420 GtkTreeIter *iter, | |
2421 GtkTreeIter *parent, | |
2422 int ind) { | |
2423 GdkPixbuf *icon = NULL; | |
2424 | |
2425 if (pixbuf) | |
2426 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); | |
2427 | |
2428 gtk_tree_store_append (prefstree, iter, parent); | |
2429 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
2430 | |
2431 if (pixbuf) | |
2432 g_object_unref(pixbuf); | |
2433 if (icon) | |
2434 g_object_unref(icon); | |
2435 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
2436 return iter; | |
2437 } | |
2438 | |
2439 void prefs_notebook_init() { | |
2440 GtkTreeIter p, p2, c; | |
2441 GList *l; | |
2442 GaimPlugin *plug; | |
2443 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
2444 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); | |
2445 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | |
2446 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
2447 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
2448 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
2449 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); | |
2450 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); | |
2451 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); | |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
2452 /* XXX */prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++); |
5440 | 2453 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); |
2454 #ifndef _WIN32 | |
2455 /* We use the registered default browser in windows */ | |
2456 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | |
2457 #endif | |
2458 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); | |
2459 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
2460 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
2461 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
2462 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
2463 | |
8170 | 2464 prefs_notebook_add_page(_("Protocols"), NULL, protocol_page(), &p, NULL, notebook_page++); |
2465 for (l = gaim_plugins_get_protocols(); l != NULL; l = l->next) { | |
2466 plug = l->data; | |
2467 | |
2468 if (GAIM_IS_PROTOCOL_PLUGIN(plug)) { | |
2469 GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plug); | |
2470 | |
2471 if (prpl_info->protocol_prefs != NULL) { | |
2472 prefs_notebook_add_page(_(plug->info->name), NULL, | |
2473 protocol_pref_page(prpl_info), &c, | |
2474 &p, notebook_page++); | |
2475 } | |
2476 } | |
2477 } | |
2478 | |
5440 | 2479 if (gaim_plugins_enabled()) { |
2480 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); | |
2481 | |
2482 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
2483 plug = l->data; | |
2484 | |
2485 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
2486 GtkWidget *config_frame; | |
2487 GaimGtkPluginUiInfo *ui_info; | |
2488 | |
2489 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
2490 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
2491 | |
2492 if (config_frame != NULL) { | |
2493 ui_info->iter = g_new0(GtkTreeIter, 1); | |
2494 prefs_notebook_add_page(_(plug->info->name), NULL, | |
2495 config_frame, ui_info->iter, | |
2496 &plugin_iter, notebook_page++); | |
2497 } | |
2498 } | |
2499 } | |
2500 } | |
2501 } | |
2502 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2503 void gaim_gtk_prefs_show(void) |
5440 | 2504 { |
2505 GtkWidget *vbox, *vbox2; | |
2506 GtkWidget *hbox; | |
2507 GtkWidget *frame; | |
2508 GtkTreeViewColumn *column; | |
2509 GtkCellRenderer *cell; | |
2510 GtkTreeSelection *sel; | |
2511 GtkWidget *notebook; | |
2512 GtkWidget *sep; | |
2513 GtkWidget *button; | |
2514 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
2515 | |
2516 if (prefs) { | |
2517 gtk_window_present(GTK_WINDOW(prefs)); | |
2518 return; | |
2519 } | |
2520 | |
2521 /* copy the preferences to tmp values... | |
2522 * I liked "take affect immediately" Oh well :-( */ | |
6016 | 2523 /* (that should have been "effect," right?) */ |
2524 | |
5440 | 2525 /* Back to instant-apply! I win! BU-HAHAHA! */ |
2526 | |
2527 /* Create the window */ | |
2528 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
2529 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); | |
2530 gtk_widget_realize(prefs); | |
2531 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); | |
2532 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); | |
2533 g_signal_connect(G_OBJECT(prefs), "destroy", | |
2534 G_CALLBACK(delete_prefs), NULL); | |
2535 | |
2536 vbox = gtk_vbox_new(FALSE, 5); | |
2537 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
2538 gtk_container_add(GTK_CONTAINER(prefs), vbox); | |
2539 gtk_widget_show(vbox); | |
2540 | |
2541 hbox = gtk_hbox_new (FALSE, 6); | |
2542 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
2543 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
2544 gtk_widget_show (hbox); | |
2545 | |
2546 frame = gtk_frame_new (NULL); | |
2547 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
2548 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
2549 gtk_widget_show (frame); | |
2550 | |
2551 /* The tree -- much inspired by the Gimp */ | |
2552 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
2553 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
2554 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
2555 | |
2556 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
2557 gtk_widget_show(tree_v); | |
2558 /* icons */ | |
2559 /* XXX: to be used at a later date | |
2560 cell = gtk_cell_renderer_pixbuf_new (); | |
2561 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
2562 */ | |
2563 | |
2564 /* text */ | |
2565 cell = gtk_cell_renderer_text_new (); | |
2566 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
2567 | |
2568 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); | |
2569 | |
2570 /* The right side */ | |
2571 frame = gtk_frame_new (NULL); | |
2572 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
2573 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
2574 gtk_widget_show (frame); | |
2575 | |
2576 vbox2 = gtk_vbox_new (FALSE, 4); | |
2577 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
2578 gtk_widget_show (vbox2); | |
2579 | |
2580 frame = gtk_frame_new (NULL); | |
2581 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
2582 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
2583 gtk_widget_show (frame); | |
2584 | |
2585 hbox = gtk_hbox_new (FALSE, 4); | |
2586 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
2587 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
2588 gtk_widget_show (hbox); | |
2589 | |
2590 preflabel = gtk_label_new(NULL); | |
2591 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
2592 gtk_widget_show (preflabel); | |
2593 | |
2594 /* The notebook */ | |
2595 prefsnotebook = notebook = gtk_notebook_new (); | |
2596 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
2597 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
2598 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
2599 | |
2600 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); | |
2601 g_signal_connect (G_OBJECT (sel), "changed", | |
2602 G_CALLBACK (pref_nb_select), | |
2603 notebook); | |
2604 gtk_widget_show(notebook); | |
2605 sep = gtk_hseparator_new(); | |
2606 gtk_widget_show(sep); | |
2607 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
2608 | |
2609 /* The buttons^H to press! */ | |
2610 hbox = gtk_hbox_new (FALSE, 6); | |
2611 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
2612 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
2613 gtk_widget_show (hbox); | |
2614 | |
2615 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); | |
2616 gtk_size_group_add_widget(sg, button); | |
2617 g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
2618 G_CALLBACK(gtk_widget_destroy), prefs); | |
2619 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2620 gtk_widget_show(button); | |
2621 | |
2622 prefs_notebook_init(); | |
2623 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2624 /* Show everything. */ |
5440 | 2625 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
2626 gtk_widget_show(prefs); | |
2627 } | |
2628 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2629 #if 0 |
5440 | 2630 static void set_logging_option(GtkWidget *w, int option) |
2631 { | |
2632 logging_options ^= option; | |
2633 | |
2634 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) | |
2635 update_log_convs(); | |
2636 } | |
2637 | |
2638 static void set_convo_option(GtkWidget *w, int option) | |
2639 { | |
2640 convo_options ^= option; | |
2641 | |
2642 if (option == OPT_CONVO_SHOW_SMILEY) | |
2643 gaim_gtkconv_toggle_smileys(); | |
2644 | |
2645 if (option == OPT_CONVO_SHOW_TIME) | |
2646 gaim_gtkconv_toggle_timestamps(); | |
2647 } | |
2648 | |
2649 static void set_im_option(GtkWidget *w, int option) | |
2650 { | |
2651 im_options ^= option; | |
2652 | |
2653 #if 0 | |
2654 if (option == OPT_IM_ONE_WINDOW) | |
2655 im_tabize(); | |
2656 #endif | |
2657 } | |
2658 | |
2659 static void set_chat_option(GtkWidget *w, int option) | |
2660 { | |
2661 chat_options ^= option; | |
2662 | |
2663 #if 0 | |
2664 if (option == OPT_CHAT_ONE_WINDOW) | |
2665 chat_tabize(); | |
2666 #endif | |
2667 } | |
2668 | |
2669 static void set_away_option(GtkWidget *w, int option) | |
2670 { | |
2671 away_options ^= option; | |
2672 | |
2673 if (option == OPT_AWAY_QUEUE) | |
2674 toggle_away_queue(); | |
2675 } | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2676 #endif |
5440 | 2677 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2678 static void |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2679 set_bool_pref(GtkWidget *w, const char *key) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2680 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2681 gaim_prefs_set_bool(key, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2682 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2683 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2684 |
7976 | 2685 GtkWidget * |
7987 | 2686 gaim_gtk_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
5440 | 2687 { |
2688 GtkWidget *button; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2689 |
5440 | 2690 button = gtk_check_button_new_with_mnemonic(text); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2691 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2692 gaim_prefs_get_bool(key)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2693 |
5440 | 2694 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2695 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2696 g_signal_connect(G_OBJECT(button), "clicked", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2697 G_CALLBACK(set_bool_pref), (char *)key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2698 |
5440 | 2699 gtk_widget_show(button); |
2700 | |
2701 return button; | |
2702 } | |
2703 | |
2704 void default_away_menu_init(GtkWidget *omenu) | |
2705 { | |
2706 GtkWidget *menu, *opt; | |
6216 | 2707 int index = 0, default_index = 0; |
5440 | 2708 GSList *awy = away_messages; |
2709 struct away_message *a; | |
6216 | 2710 const char *default_name; |
5440 | 2711 |
2712 menu = gtk_menu_new(); | |
2713 | |
6216 | 2714 default_name = gaim_prefs_get_string("/core/away/default_message"); |
2715 | |
5440 | 2716 while (awy) { |
2717 a = (struct away_message *)awy->data; | |
2718 opt = gtk_menu_item_new_with_label(a->name); | |
2719 g_signal_connect(G_OBJECT(opt), "activate", | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2720 G_CALLBACK(set_default_away), GINT_TO_POINTER(index)); |
5440 | 2721 gtk_widget_show(opt); |
2722 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
2723 | |
6216 | 2724 if(!strcmp(default_name, a->name)) |
2725 default_index = index; | |
2726 | |
5440 | 2727 awy = awy->next; |
2728 index++; | |
2729 } | |
2730 | |
2731 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2732 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
6216 | 2733 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), default_index); |
5440 | 2734 } |
2735 | |
2736 GtkWidget *pref_fg_picture = NULL; | |
2737 GtkWidget *pref_bg_picture = NULL; | |
2738 | |
2739 void destroy_colorsel(GtkWidget *w, gpointer d) | |
2740 { | |
2741 if (d) { | |
2742 gtk_widget_destroy(fgcseld); | |
2743 fgcseld = NULL; | |
2744 } else { | |
2745 gtk_widget_destroy(bgcseld); | |
2746 bgcseld = NULL; | |
2747 } | |
2748 } | |
2749 | |
2750 void apply_color_dlg(GtkWidget *w, gpointer d) | |
2751 { | |
5671 | 2752 char buf[14]; |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2753 |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2754 if (GPOINTER_TO_INT(d) == 1) { |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2755 GdkColor fgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2756 |
5440 | 2757 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION |
2758 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), | |
2759 &fgcolor); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2760 |
5671 | 2761 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2762 fgcolor.red, fgcolor.green, fgcolor.blue); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2763 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2764 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2765 |
5440 | 2766 destroy_colorsel(NULL, (void *)1); |
2767 update_color(NULL, pref_fg_picture); | |
2768 } else { | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2769 GdkColor bgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2770 |
5440 | 2771 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION |
2772 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), | |
2773 &bgcolor); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2774 |
5671 | 2775 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2776 bgcolor.red, bgcolor.green, bgcolor.blue); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2777 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2778 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2779 |
5440 | 2780 destroy_colorsel(NULL, (void *)0); |
2781 update_color(NULL, pref_bg_picture); | |
2782 } | |
2783 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); | |
2784 } | |
2785 | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2786 void set_default_away(GtkWidget *w, gpointer data) |
5440 | 2787 { |
6216 | 2788 struct away_message *default_away = NULL; |
5440 | 2789 int length = g_slist_length(away_messages); |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2790 int i = GPOINTER_TO_INT(data); |
5440 | 2791 |
2792 if (away_messages == NULL) | |
2793 default_away = NULL; | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2794 else if (i >= length) |
5440 | 2795 default_away = g_slist_nth_data(away_messages, length - 1); |
2796 else | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2797 default_away = g_slist_nth_data(away_messages, i); |
6216 | 2798 |
2799 if(default_away) | |
2800 gaim_prefs_set_string("/core/away/default_message", default_away->name); | |
2801 else | |
2802 gaim_prefs_set_string("/core/away/default_message", ""); | |
5440 | 2803 } |
2804 | |
2805 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) | |
2806 { | |
2807 /* more stuff stolen from X-Chat */ | |
2808 GtkWidget *swid; | |
2809 GdkColor c; | |
2810 GtkStyle *style; | |
2811 c.pixel = 0; | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2812 |
5440 | 2813 if (fgc) { |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2814 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_fgcolor")) { |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2815 GdkColor fgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2816 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2817 gdk_color_parse( |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2818 gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2819 &fgcolor); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2820 |
5440 | 2821 c.red = fgcolor.red; |
2822 c.blue = fgcolor.blue; | |
2823 c.green = fgcolor.green; | |
2824 } else { | |
2825 c.red = 0; | |
2826 c.blue = 0; | |
2827 c.green = 0; | |
2828 } | |
2829 } else { | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2830 if (gaim_prefs_get_bool("/gaim/gtk/conversations/use_custom_bgcolor")) { |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2831 GdkColor bgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2832 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2833 gdk_color_parse( |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2834 gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2835 &bgcolor); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2836 |
5440 | 2837 c.red = bgcolor.red; |
2838 c.blue = bgcolor.blue; | |
2839 c.green = bgcolor.green; | |
2840 } else { | |
2841 c.red = 0xffff; | |
2842 c.blue = 0xffff; | |
2843 c.green = 0xffff; | |
2844 } | |
2845 } | |
2846 | |
2847 style = gtk_style_new(); | |
2848 style->bg[0] = c; | |
2849 | |
2850 swid = gtk_event_box_new(); | |
2851 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
2852 g_object_unref(style); | |
2853 gtk_widget_set_size_request(GTK_WIDGET(swid), 40, -1); | |
2854 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2855 gtk_widget_show(swid); | |
2856 return swid; | |
2857 } | |
2858 | |
2859 void apply_font_dlg(GtkWidget *w, GtkWidget *f) | |
2860 { | |
7079 | 2861 char *fontname, *space; |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2862 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2863 fontname = |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2864 gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f)); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2865 |
5440 | 2866 destroy_fontsel(0, 0); |
2867 | |
7079 | 2868 space = strrchr(fontname, ' '); |
2869 if(space && isdigit(*(space+1))) | |
2870 *space = '\0'; | |
5440 | 2871 |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2872 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", fontname); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2873 |
5440 | 2874 g_free(fontname); |
2875 | |
2876 gaim_conversation_foreach(gaim_gtkconv_update_font_face); | |
2877 } | |
2878 | |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2879 static void |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2880 smiley_theme_pref_cb(const char *name, GaimPrefType type, gpointer value, |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2881 gpointer data) |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2882 { |
5841 | 2883 if (!strcmp(name, "/gaim/gtk/smileys/theme")) |
5771
f63a008726c6
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2884 load_smiley_theme((const char *)value, TRUE); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2885 } |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2886 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2887 void |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2888 gaim_gtk_prefs_init(void) |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2889 { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2890 gaim_prefs_add_none("/gaim"); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2891 gaim_prefs_add_none("/gaim/gtk"); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2892 gaim_prefs_add_none("/plugins/gtk"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2893 |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2894 /* XXX Move this! HACK! :( Aww... */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2895 gaim_prefs_add_none("/plugins/gtk/docklet"); |
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5551
diff
changeset
|
2896 gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2897 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2898 /* Accounts Dialog */ |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2899 gaim_prefs_add_none("/gaim/gtk/accounts"); |
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2900 gaim_prefs_add_none("/gaim/gtk/accounts/dialog"); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2901 gaim_prefs_add_int("/gaim/gtk/accounts/dialog/width", 550); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2902 gaim_prefs_add_int("/gaim/gtk/accounts/dialog/height", 250); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2903 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2904 /* Away Queueing */ |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2905 gaim_prefs_add_none("/gaim/gtk/away"); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2906 gaim_prefs_add_bool("/gaim/gtk/away/queue_messages", FALSE); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2907 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2908 /* Browsers */ |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2909 gaim_prefs_add_none("/gaim/gtk/browsers"); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2910 gaim_prefs_add_bool("/gaim/gtk/browsers/new_window", FALSE); |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2911 gaim_prefs_add_string("/gaim/gtk/browsers/command", ""); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2912 gaim_prefs_add_string("/gaim/gtk/browsers/browser", "mozilla"); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2913 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2914 /* Idle */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2915 gaim_prefs_add_none("/gaim/gtk/idle"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2916 gaim_prefs_add_string("/gaim/gtk/idle/reporting_method", "system"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2917 |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2918 /* Plugins */ |
5982
35d3c1ac5ece
[gaim-migrate @ 6430]
Christian Hammond <chipx86@chipx86.com>
parents:
5981
diff
changeset
|
2919 gaim_prefs_add_none("/gaim/gtk/plugins"); |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2920 gaim_prefs_add_string_list("/gaim/gtk/plugins/loaded", NULL); |
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2921 |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2922 /* Smiley Themes */ |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2923 gaim_prefs_add_none("/gaim/gtk/smileys"); |
5771
f63a008726c6
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2924 gaim_prefs_add_string("/gaim/gtk/smileys/theme", ""); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2925 |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2926 /* Smiley Callbacks */ |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2927 gaim_prefs_connect_callback("/gaim/gtk/smileys/theme", |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2928 smiley_theme_pref_cb, NULL); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2929 } |