Mercurial > pidgin
annotate src/gtkprefs.c @ 10169:a0529cf29ad4
[gaim-migrate @ 11258]
Applying to HEAD.
This should fix bug number 1057811, where typing right before a previously
inserted smiley would lose the formatting. Since smileys aren't text,
the tags weren't getting applied to them (they're child anchors, btw) so
typing right before them picked up this lack of formatting.
So I fixed it by applying tags to child anchors like we do normal text.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Thu, 11 Nov 2004 02:26:44 +0000 |
parents | e6372844a4b8 |
children | 5b33637b69fd |
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 */ | |
9791 | 26 #include "internal.h" |
27 #include "gtkgaim.h" | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
28 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
29 #include "debug.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
30 #include "notify.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
31 #include "prefs.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
32 #include "proxy.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
33 #include "prpl.h" |
9508 | 34 #include "request.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
35 #include "sound.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
36 #include "util.h" |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
37 #include "network.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
38 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
39 #include "gtkblist.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
40 #include "gtkconv.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
41 #include "gtkdebug.h" |
9709 | 42 #include "gtkdialogs.h" |
5440 | 43 #include "gtkimhtml.h" |
8833 | 44 #include "gtkimhtmltoolbar.h" |
5440 | 45 #include "gtkplugin.h" |
8713 | 46 #include "gtkpluginpref.h" |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
47 #include "gtkprefs.h" |
5684 | 48 #include "gtksound.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
49 #include "gtkutils.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
50 #include "stock.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
51 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
52 #define PROXYHOST 0 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
53 #define PROXYPORT 1 |
6005 | 54 #define PROXYUSER 2 |
55 #define PROXYPASS 3 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
56 |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
57 /* 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
|
58 GtkListStore *prefs_away_store = NULL; |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
59 GtkWidget *prefs_away_menu = NULL; |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
60 |
5440 | 61 static int sound_row_sel = 0; |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
62 static GtkWidget *prefsnotebook; |
5440 | 63 |
64 static GtkWidget *sound_entry = NULL; | |
65 static GtkListStore *smiley_theme_store = NULL; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
66 static GtkWidget *prefs_proxy_frame = NULL; |
5440 | 67 |
68 static GtkWidget *prefs = NULL; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
69 static GtkWidget *debugbutton = NULL; |
5440 | 70 static int notebook_page = 0; |
8713 | 71 static GtkTreeIter proto_iter, plugin_iter; |
5440 | 72 |
73 /* | |
74 * PROTOTYPES | |
75 */ | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
76 static GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
77 GtkWidget*, GtkTreeIter*, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
78 GtkTreeIter*, int); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
79 static void delete_prefs(GtkWidget *, void *); |
5440 | 80 static void update_plugin_list(void *data); |
81 | |
9944 | 82 /* XXX CORE/UI |
7931 | 83 static void set_default_away(GtkWidget *, gpointer); |
9944 | 84 */ |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
85 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
86 static void |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
87 update_spin_value(GtkWidget *w, GtkWidget *spin) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
88 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
89 const char *key = g_object_get_data(G_OBJECT(spin), "val"); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
90 int value; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
91 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
92 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
|
93 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
94 gaim_prefs_set_int(key, value); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
95 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
96 |
7976 | 97 GtkWidget * |
7987 | 98 gaim_gtk_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
99 char *key, int min, int max, GtkSizeGroup *sg) | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
100 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
101 GtkWidget *hbox; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
102 GtkWidget *label; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
103 GtkWidget *spin; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
104 GtkObject *adjust; |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
105 int val; |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
106 |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
107 val = gaim_prefs_get_int(key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
108 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
109 hbox = gtk_hbox_new(FALSE, 5); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
110 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
111 gtk_widget_show(hbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
112 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
113 label = gtk_label_new_with_mnemonic(title); |
8713 | 114 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
115 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
116 gtk_widget_show(label); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
117 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
118 adjust = gtk_adjustment_new(val, min, max, 1, 1, 1); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
119 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
120 g_object_set_data(G_OBJECT(spin), "val", key); |
8467 | 121 if (max < 10000) |
122 gtk_widget_set_size_request(spin, 50, -1); | |
123 else | |
124 gtk_widget_set_size_request(spin, 60, -1); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
125 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
126 g_signal_connect(G_OBJECT(adjust), "value-changed", |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
127 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
128 gtk_widget_show(spin); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
129 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
130 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
131 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
132 if (sg) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
133 gtk_size_group_add_widget(sg, label); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
134 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
135 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
136 |
8137 | 137 gaim_set_accessible_label (spin, label); |
138 | |
8238 | 139 return hbox; |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
140 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
141 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
142 static void |
9422 | 143 entry_set(GtkEntry *entry, gpointer data) { |
144 char *key = (char*)data; | |
145 | |
146 gaim_prefs_set_string(key, gtk_entry_get_text(entry)); | |
147 } | |
148 | |
149 GtkWidget * | |
150 gaim_gtk_prefs_labeled_entry(GtkWidget *page, const gchar *title, char *key, | |
151 GtkSizeGroup *sg) | |
152 { | |
153 GtkWidget *hbox, *label, *entry; | |
154 const gchar *value; | |
155 | |
156 value = gaim_prefs_get_string(key); | |
157 | |
158 hbox = gtk_hbox_new(FALSE, 5); | |
159 gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 5); | |
160 gtk_widget_show(hbox); | |
161 | |
162 label = gtk_label_new_with_mnemonic(title); | |
163 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
164 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
165 gtk_widget_show(label); | |
166 | |
167 entry = gtk_entry_new(); | |
168 gtk_entry_set_text(GTK_ENTRY(entry), value); | |
169 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
170 g_signal_connect(G_OBJECT(entry), "changed", | |
171 G_CALLBACK(entry_set), (char*)key); | |
172 gtk_widget_show(entry); | |
173 | |
174 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
175 | |
176 if(sg) { | |
177 gtk_size_group_add_widget(sg, label); | |
178 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
179 } | |
180 | |
181 gaim_set_accessible_label(entry, label); | |
182 | |
183 return hbox; | |
184 } | |
185 | |
186 static void | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
187 dropdown_set(GObject *w, const char *key) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
188 { |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
189 const char *str_value; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
190 int int_value; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
191 GaimPrefType type; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
192 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
193 type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
194 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
195 if (type == GAIM_PREF_INT) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
196 int_value = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
197 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
198 gaim_prefs_set_int(key, int_value); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
199 } |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
200 else if (type == GAIM_PREF_STRING) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
201 str_value = (const char *)g_object_get_data(w, "value"); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
202 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
203 gaim_prefs_set_string(key, str_value); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
204 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
205 else if (type == GAIM_PREF_BOOLEAN) { |
9151 | 206 gaim_prefs_set_bool(key, |
207 GPOINTER_TO_INT(g_object_get_data(w, "value"))); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
208 } |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
209 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
210 |
7976 | 211 GtkWidget * |
7987 | 212 gaim_gtk_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
213 GaimPrefType type, const char *key, GList *menuitems) | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
214 { |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
215 GtkWidget *dropdown, *opt, *menu; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
216 GtkWidget *label; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
217 GtkWidget *hbox; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
218 gchar *text; |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
219 const char *stored_str = NULL; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
220 int stored_int = 0; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
221 int int_value = 0; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
222 const char *str_value = NULL; |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
223 int o = 0; |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
224 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
225 g_return_val_if_fail(menuitems != NULL, NULL); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
226 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
227 hbox = gtk_hbox_new(FALSE, 5); |
8713 | 228 /*gtk_container_add (GTK_CONTAINER (box), hbox);*/ |
229 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
230 gtk_widget_show(hbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
231 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
232 label = gtk_label_new_with_mnemonic(title); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
233 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
234 gtk_widget_show(label); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
235 |
8577 | 236 #if 0 /* GTK_CHECK_VERSION(2,4,0) */ |
237 if(type == GAIM_PREF_INT) | |
238 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); | |
239 else if(type == GAIM_PREF_STRING) | |
240 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); | |
241 dropdown = gtk_combo_box_new_with_model(model); | |
242 #else | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
243 dropdown = gtk_option_menu_new(); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
244 menu = gtk_menu_new(); |
8577 | 245 #endif |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
246 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
247 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
248 |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
249 if (type == GAIM_PREF_INT) |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
250 stored_int = gaim_prefs_get_int(key); |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
251 else if (type == GAIM_PREF_STRING) |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
252 stored_str = gaim_prefs_get_string(key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
253 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
254 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
255 menuitems = g_list_next(menuitems); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
256 g_return_val_if_fail(menuitems != NULL, NULL); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
257 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
258 opt = gtk_menu_item_new_with_label(text); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
259 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
260 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
|
261 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
262 if (type == GAIM_PREF_INT) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
263 int_value = GPOINTER_TO_INT(menuitems->data); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
264 g_object_set_data(G_OBJECT(opt), "value", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
265 GINT_TO_POINTER(int_value)); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
266 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
267 else if (type == GAIM_PREF_STRING) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
268 str_value = (const char *)menuitems->data; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
269 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
270 g_object_set_data(G_OBJECT(opt), "value", (char *)str_value); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
271 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
272 else if (type == GAIM_PREF_BOOLEAN) { |
9151 | 273 g_object_set_data(G_OBJECT(opt), "value", |
274 menuitems->data); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
275 } |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
276 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
277 g_signal_connect(G_OBJECT(opt), "activate", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
278 G_CALLBACK(dropdown_set), (char *)key); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
279 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
280 gtk_widget_show(opt); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
281 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
282 |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
283 if ((type == GAIM_PREF_INT && stored_int == int_value) || |
5753
96214f5de47c
[gaim-migrate @ 6178]
Christian Hammond <chipx86@chipx86.com>
parents:
5716
diff
changeset
|
284 (type == GAIM_PREF_STRING && stored_str != NULL && |
96214f5de47c
[gaim-migrate @ 6178]
Christian Hammond <chipx86@chipx86.com>
parents:
5716
diff
changeset
|
285 !strcmp(stored_str, str_value)) || |
9151 | 286 (type == GAIM_PREF_BOOLEAN && |
287 (gaim_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) { | |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
288 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
289 gtk_menu_set_active(GTK_MENU(menu), o); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
290 } |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
291 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
292 menuitems = g_list_next(menuitems); |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
293 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
294 o++; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
295 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
296 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
297 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
298 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
299 gtk_widget_show(dropdown); |
8137 | 300 gaim_set_accessible_label (dropdown, label); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
301 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
302 return label; |
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 |
7976 | 305 GtkWidget * |
7987 | 306 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
|
307 const char *key, ...) |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
308 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
309 va_list ap; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
310 GList *menuitems = NULL; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
311 GtkWidget *dropdown = NULL; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
312 char *name; |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
313 int int_value; |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
314 const char *str_value; |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
315 |
9151 | 316 g_return_val_if_fail(type == GAIM_PREF_BOOLEAN || type == GAIM_PREF_INT || |
317 type == GAIM_PREF_STRING, NULL); | |
318 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
319 va_start(ap, key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
320 while ((name = va_arg(ap, char *)) != NULL) { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
321 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
322 menuitems = g_list_prepend(menuitems, name); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
323 |
9151 | 324 if (type == GAIM_PREF_INT || type == GAIM_PREF_BOOLEAN) { |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
325 int_value = va_arg(ap, int); |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
326 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value)); |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
327 } |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
328 else { |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
329 str_value = va_arg(ap, const char *); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
330 menuitems = g_list_prepend(menuitems, (char *)str_value); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
331 } |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
332 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
333 va_end(ap); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
334 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
335 g_return_val_if_fail(menuitems != NULL, NULL); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
336 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
337 menuitems = g_list_reverse(menuitems); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
338 |
7987 | 339 dropdown = gaim_gtk_prefs_dropdown_from_list(box, title, type, key, |
340 menuitems); | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
341 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
342 g_list_free(menuitems); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
343 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
344 return dropdown; |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
345 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
346 |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
347 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
348 delete_prefs(GtkWidget *asdf, void *gdsa) |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
349 { |
5440 | 350 GList *l; |
351 GaimPlugin *plug; | |
352 | |
9508 | 353 /* Close any "select sound" request dialogs */ |
354 gaim_request_close_with_handle(prefs); | |
355 | |
5440 | 356 gaim_plugins_unregister_probe_notify_cb(update_plugin_list); |
357 | |
10087 | 358 /* Unregister callbacks. */ |
359 gaim_prefs_disconnect_by_handle(prefs); | |
360 | |
5440 | 361 prefs = NULL; |
362 sound_entry = NULL; | |
363 debugbutton = NULL; | |
364 prefs_away_menu = NULL; | |
365 notebook_page = 0; | |
366 smiley_theme_store = NULL; | |
367 g_object_unref(G_OBJECT(prefs_away_store)); | |
368 prefs_away_store = NULL; | |
369 | |
370 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
371 plug = l->data; | |
372 | |
373 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
374 GaimGtkPluginUiInfo *ui_info; | |
375 | |
376 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
377 | |
378 if (ui_info->iter != NULL) { | |
379 g_free(ui_info->iter); | |
380 ui_info->iter = NULL; | |
381 } | |
382 } | |
8745 | 383 |
384 if(GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { | |
385 GaimPluginUiInfo *prefs_info; | |
386 | |
387 prefs_info = GAIM_PLUGIN_UI_INFO(plug); | |
388 | |
8814 | 389 if(prefs_info->frame != NULL) { |
390 gaim_plugin_pref_frame_destroy(prefs_info->frame); | |
391 prefs_info->frame = NULL; | |
392 } | |
393 | |
8745 | 394 if(prefs_info->iter != NULL) { |
395 g_free(prefs_info->iter); | |
396 prefs_info->iter = NULL; | |
397 } | |
398 } | |
5440 | 399 } |
400 } | |
401 | |
402 | |
403 /* These are the pages in the preferences notebook */ | |
404 GtkWidget *interface_page() { | |
405 GtkWidget *ret; | |
406 GtkWidget *vbox; | |
407 ret = gtk_vbox_new(FALSE, 18); | |
408 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
409 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
410 vbox = gaim_gtk_make_frame(ret, _("Interface Options")); |
5440 | 411 |
7987 | 412 gaim_gtk_prefs_checkbox(_("D_isplay remote nicknames if no alias is set"), |
413 "/core/buddies/use_server_alias", vbox); | |
5440 | 414 |
415 | |
416 gtk_widget_show_all(ret); | |
417 return ret; | |
418 } | |
419 | |
420 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
421 GtkTreeIter iter; | |
422 const char *filename; | |
423 GValue val = { 0, }; | |
5841 | 424 |
5440 | 425 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
426 return; | |
427 gtk_tree_model_get_value (model, &iter, 2, &val); | |
428 filename = g_value_get_string(&val); | |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
429 gaim_prefs_set_string("/gaim/gtk/smileys/theme", filename); |
5440 | 430 g_value_unset (&val); |
431 } | |
432 | |
433 GtkTreePath *theme_refresh_theme_list() | |
434 { | |
435 GdkPixbuf *pixbuf; | |
436 GSList *themes; | |
437 GtkTreeIter iter; | |
438 GtkTreePath *path = NULL; | |
439 int ind = 0; | |
440 | |
441 | |
442 smiley_theme_probe(); | |
443 | |
444 if (!smiley_themes) | |
445 return NULL; | |
446 | |
447 themes = smiley_themes; | |
448 | |
449 gtk_list_store_clear(smiley_theme_store); | |
450 | |
451 while (themes) { | |
452 struct smiley_theme *theme = themes->data; | |
453 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
454 "<span size='smaller' foreground='dim grey'>%s</span>", | |
455 theme->name, theme->author, theme->desc); | |
456 gtk_list_store_append (smiley_theme_store, &iter); | |
8494 | 457 |
458 /* | |
459 * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it | |
460 * looks like it should be ok to me. Anyone know what's up? --Mark | |
461 */ | |
8963 | 462 pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, NULL) : NULL); |
5440 | 463 |
464 gtk_list_store_set(smiley_theme_store, &iter, | |
465 0, pixbuf, | |
466 1, description, | |
467 2, theme->path, | |
8928 | 468 3, theme->name, |
5440 | 469 -1); |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
470 |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
471 if (pixbuf != NULL) |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
472 g_object_unref(G_OBJECT(pixbuf)); |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
473 |
5440 | 474 g_free(description); |
475 themes = themes->next; | |
476 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
477 /* path = gtk_tree_path_new_from_indices(ind); */ | |
478 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
479 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
480 g_free(iwishihadgtk2_2); | |
481 } | |
482 ind++; | |
483 } | |
484 | |
485 return path; | |
486 } | |
487 | |
488 void theme_install_theme(char *path, char *extn) { | |
489 #ifndef _WIN32 | |
9769 | 490 gchar *command, *escaped; |
5440 | 491 #endif |
492 gchar *destdir; | |
493 gchar *tail; | |
8494 | 494 GtkTreePath *themepath = NULL; |
5440 | 495 |
496 /* Just to be safe */ | |
497 g_strchomp(path); | |
498 | |
499 /* I dont know what you are, get out of here */ | |
500 if (extn != NULL) | |
501 tail = extn; | |
502 else if ((tail = strrchr(path, '.')) == NULL) | |
503 return; | |
504 | |
505 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); | |
506 | |
507 /* We'll check this just to make sure. This also lets us do something different on | |
508 * other platforms, if need be */ | |
509 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { | |
510 #ifndef _WIN32 | |
9769 | 511 escaped = g_shell_quote(path); |
512 command = g_strdup_printf("tar > /dev/null xzf %s -C %s", escaped, destdir); | |
513 g_free(escaped); | |
5440 | 514 #else |
515 if(!wgaim_gz_untar(path, destdir)) { | |
516 g_free(destdir); | |
517 return; | |
518 } | |
519 #endif | |
520 } | |
521 else { | |
522 g_free(destdir); | |
523 return; | |
524 } | |
525 | |
526 #ifndef _WIN32 | |
527 /* Fire! */ | |
528 system(command); | |
529 | |
530 g_free(command); | |
531 #endif | |
532 g_free(destdir); | |
533 | |
8494 | 534 themepath = theme_refresh_theme_list(); |
535 if (themepath != NULL) | |
536 gtk_tree_path_free(themepath); | |
5440 | 537 } |
538 | |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
539 static void |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
540 theme_got_url(void *data, const char *themedata, size_t len) |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
541 { |
5440 | 542 FILE *f; |
543 gchar *path; | |
544 | |
545 f = gaim_mkstemp(&path); | |
546 fwrite(themedata, len, 1, f); | |
547 fclose(f); | |
548 | |
549 theme_install_theme(path, data); | |
550 | |
551 unlink(path); | |
552 g_free(path); | |
553 } | |
554 | |
555 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, | |
556 guint info, guint t, gpointer data) { | |
557 gchar *name = sd->data; | |
558 | |
559 if ((sd->length >= 0) && (sd->format == 8)) { | |
560 /* Well, it looks like the drag event was cool. | |
561 * Let's do something with it */ | |
562 | |
563 if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
564 GError *converr = NULL; | |
565 gchar *tmp; | |
566 /* It looks like we're dealing with a local file. Let's | |
567 * just untar it in the right place */ | |
568 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { | |
569 gaim_debug(GAIM_DEBUG_ERROR, "theme dnd", "%s\n", | |
570 (converr ? converr->message : | |
571 "g_filename_from_uri error")); | |
572 return; | |
573 } | |
574 theme_install_theme(tmp, NULL); | |
575 g_free(tmp); | |
576 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { | |
577 /* Oo, a web drag and drop. This is where things | |
578 * will start to get interesting */ | |
579 gchar *tail; | |
580 | |
581 if ((tail = strrchr(name, '.')) == NULL) | |
582 return; | |
583 | |
584 /* We'll check this just to make sure. This also lets us do something different on | |
585 * other platforms, if need be */ | |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7092
diff
changeset
|
586 gaim_url_fetch(name, TRUE, NULL, FALSE, theme_got_url, ".tgz"); |
5440 | 587 } |
588 | |
589 gtk_drag_finish(dc, TRUE, FALSE, t); | |
590 } | |
591 | |
592 gtk_drag_finish(dc, FALSE, FALSE, t); | |
593 } | |
594 | |
8928 | 595 /* Does same as normal sort, except "none" is sorted first */ |
596 gint gaim_sort_smileys (GtkTreeModel *model, | |
597 GtkTreeIter *a, | |
598 GtkTreeIter *b, | |
599 gpointer userdata) | |
600 { | |
601 gint ret = 0; | |
9949 | 602 gchar *name1 = NULL, *name2 = NULL; |
8928 | 603 |
604 gtk_tree_model_get(model, a, 3, &name1, -1); | |
605 gtk_tree_model_get(model, b, 3, &name2, -1); | |
606 | |
607 if (name1 == NULL || name2 == NULL) { | |
608 if (!(name1 == NULL && name2 == NULL)) | |
609 ret = (name1 == NULL) ? -1: 1; | |
610 } else if (!g_ascii_strcasecmp(name1, "none")) { | |
10167 | 611 if (!g_utf8_collate(name1, name2)) |
612 ret = 0; | |
613 else | |
614 /* Sort name1 first */ | |
615 ret = -1; | |
8928 | 616 } else if (!g_ascii_strcasecmp(name2, "none")) { |
617 /* Sort name2 first */ | |
618 ret = 1; | |
619 } else { | |
620 /* Neither string is "none", default to normal sort */ | |
621 ret = g_utf8_collate(name1,name2); | |
622 } | |
623 | |
9521 | 624 g_free(name1); |
625 g_free(name2); | |
626 | |
8928 | 627 return ret; |
628 } | |
629 | |
5440 | 630 GtkWidget *theme_page() { |
631 GtkWidget *ret; | |
632 GtkWidget *sw; | |
633 GtkWidget *view; | |
634 GtkCellRenderer *rend; | |
635 GtkTreeViewColumn *col; | |
636 GtkTreeSelection *sel; | |
637 GtkTreePath *path = NULL; | |
638 GtkWidget *label; | |
639 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; | |
640 | |
641 ret = gtk_vbox_new(FALSE, 18); | |
642 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
643 | |
644 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.")); | |
645 | |
646 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
647 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
648 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
649 | |
650 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
651 gtk_widget_show(label); | |
652 | |
653 sw = gtk_scrolled_window_new(NULL,NULL); | |
7939 | 654 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
7931 | 655 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
5440 | 656 |
657 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
8928 | 658 smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); |
5440 | 659 |
660 path = theme_refresh_theme_list(); | |
8075 | 661 |
5440 | 662 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
663 | |
664 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
665 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
666 | |
667 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
668 | |
669 rend = gtk_cell_renderer_pixbuf_new(); | |
670 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
671 | |
672 if(path) { | |
673 gtk_tree_selection_select_path(sel, path); | |
674 gtk_tree_path_free(path); | |
675 } | |
8928 | 676 |
677 /* Custom sort so "none" theme is at top of list */ | |
678 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_store), | |
679 3, gaim_sort_smileys, NULL, NULL); | |
680 | |
8075 | 681 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store), |
8928 | 682 3, GTK_SORT_ASCENDING); |
5440 | 683 |
684 col = gtk_tree_view_column_new_with_attributes (_("Icon"), | |
685 rend, | |
686 "pixbuf", 0, | |
687 NULL); | |
688 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
689 | |
690 rend = gtk_cell_renderer_text_new(); | |
691 col = gtk_tree_view_column_new_with_attributes (_("Description"), | |
692 rend, | |
693 "markup", 1, | |
694 NULL); | |
695 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
696 g_object_unref(G_OBJECT(smiley_theme_store)); | |
697 gtk_container_add(GTK_CONTAINER(sw), view); | |
698 | |
8075 | 699 g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL); |
5440 | 700 |
701 gtk_widget_show_all(ret); | |
8137 | 702 |
703 gaim_set_accessible_label (view, label); | |
704 | |
5440 | 705 return ret; |
706 } | |
707 | |
9025 | 708 static void |
709 formatting_reset_cb(GtkWidget *w, GtkWidget* imhtml) { | |
710 gboolean bold, italic, uline; | |
711 bold = italic = uline = FALSE; | |
712 | |
713 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), &bold, &italic, &uline); | |
714 if (bold) | |
715 gtk_imhtml_toggle_bold(GTK_IMHTML(imhtml)); | |
716 if (italic) | |
717 gtk_imhtml_toggle_italic(GTK_IMHTML(imhtml)); | |
718 if (uline) | |
719 gtk_imhtml_toggle_underline(GTK_IMHTML(imhtml)); | |
720 | |
721 gtk_imhtml_font_set_size(GTK_IMHTML(imhtml), 3); | |
722 gtk_imhtml_toggle_forecolor(GTK_IMHTML(imhtml), NULL); | |
723 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), NULL); | |
724 gtk_imhtml_toggle_fontface(GTK_IMHTML(imhtml), NULL); | |
725 } | |
726 | |
727 static void | |
728 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *bah) | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
729 { |
9025 | 730 gboolean bold, italic, uline; |
731 | |
732 bold = italic = uline = FALSE; | |
733 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), | |
734 &bold, &italic, &uline); | |
735 | |
736 if (buttons & GTK_IMHTML_BOLD) | |
737 gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold", bold); | |
738 if (buttons & GTK_IMHTML_ITALIC) | |
739 gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic", italic); | |
740 if (buttons & GTK_IMHTML_UNDERLINE) | |
741 gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline", uline); | |
742 | |
743 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK) | |
744 gaim_prefs_set_int("/gaim/gtk/conversations/font_size", | |
745 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); | |
746 if (buttons & GTK_IMHTML_FACE) { | |
747 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); | |
748 if (!face) | |
749 face = g_strdup(""); | |
750 | |
751 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", face); | |
752 g_free(face); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
753 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
754 |
9025 | 755 if (buttons & GTK_IMHTML_FORECOLOR) { |
756 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); | |
757 if (!color) | |
758 color = g_strdup(""); | |
759 | |
760 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", color); | |
761 g_free(color); | |
762 } | |
763 | |
764 if (buttons & GTK_IMHTML_BACKCOLOR) { | |
765 char *color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); | |
766 if (!color) | |
767 color = g_strdup(""); | |
768 | |
769 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", color); | |
770 g_free(color); | |
771 } | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
772 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
773 |
8988 | 774 GtkWidget *messages_page() { |
5440 | 775 GtkWidget *ret; |
9025 | 776 GtkWidget *vbox, *fontvbox; |
8833 | 777 GtkWidget *imhtml; |
778 GtkWidget *toolbar; | |
779 GtkWidget *sw; | |
8988 | 780 GtkWidget *frame; |
9025 | 781 GtkWidget *option; |
782 GtkWidget *button; | |
5440 | 783 |
784 ret = gtk_vbox_new(FALSE, 18); | |
785 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
786 | |
8988 | 787 vbox = gaim_gtk_make_frame (ret, _("Display")); |
788 gaim_gtk_prefs_checkbox(_("Show _timestamp on messages"), | |
789 "/gaim/gtk/conversations/show_timestamps", vbox); | |
790 #ifdef USE_GTKSPELL | |
791 gaim_gtk_prefs_checkbox(_("_Highlight misspelled words"), | |
792 "/gaim/gtk/conversations/spellcheck", vbox); | |
793 #endif | |
9049 | 794 vbox = gaim_gtk_make_frame (ret, _("Ignore")); |
795 gaim_gtk_prefs_checkbox(_("Ignore c_olors"), | |
796 "/gaim/gtk/conversations/ignore_colors", vbox); | |
797 gaim_gtk_prefs_checkbox(_("Ignore font _faces"), | |
798 "/gaim/gtk/conversations/ignore_fonts", vbox); | |
799 gaim_gtk_prefs_checkbox(_("Ignore font si_zes"), | |
800 "/gaim/gtk/conversations/ignore_font_sizes", vbox); | |
8988 | 801 |
802 vbox = gaim_gtk_make_frame (ret, _("Default Formatting")); | |
803 | |
9025 | 804 option = gaim_gtk_prefs_checkbox(_("_Send default formatting with outgoing messages"), |
805 "/gaim/gtk/conversations/send_formatting", vbox); | |
806 | |
8988 | 807 frame = gtk_frame_new(NULL); |
808 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); | |
809 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0); | |
810 | |
9025 | 811 fontvbox = gtk_vbox_new(FALSE, 0); |
812 gtk_container_add(GTK_CONTAINER(frame), fontvbox); | |
8988 | 813 |
8833 | 814 toolbar = gtk_imhtmltoolbar_new(); |
9025 | 815 gtk_box_pack_start(GTK_BOX(fontvbox), toolbar, FALSE, FALSE, 0); |
8833 | 816 |
817 sw = gtk_scrolled_window_new(NULL, NULL); | |
818 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
819 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
8988 | 820 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
9025 | 821 gtk_box_pack_start(GTK_BOX(fontvbox), sw, TRUE, TRUE, 0); |
8833 | 822 |
823 imhtml = gtk_imhtml_new(NULL, NULL); | |
9025 | 824 gtk_widget_set_name(imhtml, "gaim_gtkprefs_font_imhtml"); |
8833 | 825 gtk_imhtml_set_editable(GTK_IMHTML(imhtml), TRUE); |
826 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), GTK_IMHTML_ALL ^ GTK_IMHTML_IMAGE); | |
8836 | 827 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); |
8833 | 828 |
829 gtk_imhtmltoolbar_attach(GTK_IMHTMLTOOLBAR(toolbar), imhtml); | |
830 gtk_imhtmltoolbar_associate_smileys(GTK_IMHTMLTOOLBAR(toolbar), "default"); | |
831 gaim_setup_imhtml(imhtml); | |
9025 | 832 gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting. :)"), 0); |
8833 | 833 gtk_container_add(GTK_CONTAINER(sw), imhtml); |
8988 | 834 |
9056 | 835 button = gtk_button_new_with_mnemonic(_("_Clear Formatting")); |
9025 | 836 gtk_box_pack_start(GTK_BOX(fontvbox), button, FALSE, FALSE, 0); |
837 | |
838 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/send_formatting")) | |
839 gtk_widget_set_sensitive(fontvbox, FALSE); | |
840 | |
8836 | 841 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_bold")) |
842 gtk_imhtml_toggle_bold(GTK_IMHTML(imhtml)); | |
843 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_italic")) | |
844 gtk_imhtml_toggle_italic(GTK_IMHTML(imhtml)); | |
845 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_underline")) | |
846 gtk_imhtml_toggle_underline(GTK_IMHTML(imhtml)); | |
847 | |
848 gtk_imhtml_font_set_size(GTK_IMHTML(imhtml), gaim_prefs_get_int("/gaim/gtk/conversations/font_size")); | |
849 gtk_imhtml_toggle_forecolor(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor")); | |
850 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor")); | |
851 gtk_imhtml_toggle_fontface(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/font_face")); | |
852 | |
9025 | 853 g_signal_connect(G_OBJECT(button), "clicked", |
854 G_CALLBACK(formatting_reset_cb), imhtml); | |
855 | |
856 g_signal_connect(G_OBJECT(option), "clicked", | |
857 G_CALLBACK(gaim_gtk_toggle_sensitive), fontvbox); | |
858 | |
859 g_signal_connect(G_OBJECT(imhtml), "format_function_toggle", | |
860 G_CALLBACK(formatting_toggle_cb), NULL); | |
861 | |
5440 | 862 gtk_widget_show_all(ret); |
863 return ret; | |
864 } | |
865 | |
866 GtkWidget *hotkeys_page() { | |
867 GtkWidget *ret; | |
868 GtkWidget *vbox; | |
869 ret = gtk_vbox_new(FALSE, 18); | |
870 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
871 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
872 vbox = gaim_gtk_make_frame (ret, _("Window Closing")); |
7987 | 873 gaim_gtk_prefs_checkbox(_("_Escape closes window"), |
874 "/gaim/gtk/conversations/escape_closes", vbox); | |
5440 | 875 |
876 gtk_widget_show_all(ret); | |
877 return ret; | |
878 } | |
879 | |
880 GtkWidget *list_page() { | |
881 GtkWidget *ret; | |
882 GtkWidget *vbox; | |
883 GList *l= NULL; | |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
884 GSList *sl; |
5440 | 885 ret = gtk_vbox_new(FALSE, 18); |
886 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
7305 | 887 |
888 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
889 vbox = gaim_gtk_make_frame (ret, _("Buddy List Sorting")); |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
890 |
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
891 for (sl = gaim_gtk_blist_sort_methods; sl != NULL; sl = sl->next) { |
5631 | 892 struct gaim_gtk_blist_sort_method *method = sl->data; |
893 | |
894 l = g_list_append(l, method->name); | |
895 l = g_list_append(l, method->id); | |
5440 | 896 } |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
897 |
8063 | 898 gaim_gtk_prefs_dropdown_from_list(vbox, _("_Sorting:"), GAIM_PREF_STRING, |
7987 | 899 "/gaim/gtk/blist/sort_type", l); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
900 |
5440 | 901 g_list_free(l); |
902 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
903 vbox = gaim_gtk_make_frame (ret, _("Buddy Display")); |
7987 | 904 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), |
7305 | 905 "/gaim/gtk/blist/show_buddy_icons", vbox); |
7987 | 906 gaim_gtk_prefs_checkbox(_("Show _warning levels"), |
7305 | 907 "/gaim/gtk/blist/show_warning_level", vbox); |
7987 | 908 gaim_gtk_prefs_checkbox(_("Show idle _times"), |
7305 | 909 "/gaim/gtk/blist/show_idle_time", vbox); |
7987 | 910 gaim_gtk_prefs_checkbox(_("_Automatically expand contacts"), |
7731 | 911 "/gaim/gtk/blist/auto_expand_contacts", vbox); |
5440 | 912 |
913 gtk_widget_show_all(ret); | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
914 |
5440 | 915 return ret; |
916 } | |
917 | |
8979 | 918 static void |
9155 | 919 conversation_usetabs_cb(const char *name, GaimPrefType type, gpointer value, |
8979 | 920 gpointer data) |
921 { | |
10112 | 922 gboolean usetabs = GPOINTER_TO_INT(value); |
9155 | 923 |
924 if (usetabs) | |
925 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); | |
926 else | |
8979 | 927 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
928 } | |
929 | |
5440 | 930 GtkWidget *conv_page() { |
931 GtkWidget *ret; | |
9155 | 932 GtkWidget *vbox, *vbox2; |
5440 | 933 GtkWidget *label; |
934 GtkSizeGroup *sg; | |
935 GList *names = NULL; | |
936 | |
937 ret = gtk_vbox_new(FALSE, 18); | |
938 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
939 | |
940 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
941 vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
5440 | 942 |
9150 | 943 label = gaim_gtk_prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
944 "/gaim/gtk/conversations/button_type", | |
945 _("Pictures"), GAIM_BUTTON_IMAGE, | |
946 _("Text"), GAIM_BUTTON_TEXT, | |
947 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, | |
948 _("None"), GAIM_BUTTON_NONE, | |
949 NULL); | |
950 gtk_size_group_add_widget(sg, label); | |
951 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
952 | |
9832 | 953 #if 0 |
9301 | 954 gaim_gtk_prefs_checkbox(_("Enable \"_slash\" commands"), |
955 "/gaim/gtk/conversations/enable_commands", vbox); | |
9832 | 956 #endif |
957 gaim_gtk_prefs_checkbox(_("Send unknown \"_slash\" commands as messages"), | |
958 "/gaim/gtk/conversations/passthrough_unknown_commands", vbox); | |
9301 | 959 |
8600 | 960 gaim_gtk_prefs_checkbox(_("Show _formatting toolbar"), |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7305
diff
changeset
|
961 "/gaim/gtk/conversations/show_formatting_toolbar", vbox); |
9155 | 962 gaim_gtk_prefs_checkbox(_("Show _aliases in tabs/titles"), |
8015 | 963 "/core/conversations/use_alias_for_title", vbox); |
9150 | 964 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), |
965 "/gaim/gtk/conversations/im/show_buddy_icons", vbox); | |
9155 | 966 gaim_gtk_prefs_checkbox(_("Enable buddy ic_on animation"), |
9150 | 967 "/gaim/gtk/conversations/im/animate_buddy_icons", vbox); |
9155 | 968 gaim_gtk_prefs_checkbox(_("_Notify buddies that you are typing to them"), |
9150 | 969 "/core/conversations/im/send_typing", vbox); |
9301 | 970 gaim_gtk_prefs_checkbox(_("_Raise IM window on events"), |
971 "/gaim/gtk/conversations/im/raise_on_events", vbox); | |
972 | |
9303 | 973 gaim_gtk_prefs_checkbox(_("Raise chat _window on events"), |
9301 | 974 "/gaim/gtk/conversations/chat/raise_on_events", vbox); |
9155 | 975 |
976 /* All the tab options! */ | |
977 vbox = gaim_gtk_make_frame(ret, _("Tab Options")); | |
978 | |
979 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
|
980 "/gaim/gtk/conversations/tabs", vbox); |
9155 | 981 |
982 /* | |
983 * Connect a signal to the above preference. When conversations are not | |
984 * shown in a tabbed window then all tabbing options should be disabled. | |
985 */ | |
986 vbox2 = gtk_vbox_new(FALSE, 0); | |
987 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); | |
10087 | 988 gaim_prefs_connect_callback(prefs, "/gaim/gtk/conversations/tabs", |
989 conversation_usetabs_cb, vbox2); | |
9155 | 990 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) |
991 gtk_widget_set_sensitive(vbox2, FALSE); | |
992 | |
9891 | 993 gaim_gtk_prefs_checkbox(_("Show close b_utton on tabs"), |
9155 | 994 "/gaim/gtk/conversations/close_on_tabs", vbox2); |
995 | |
996 label = gaim_gtk_prefs_dropdown(vbox2, _("Tab p_lacement:"), GAIM_PREF_INT, | |
8988 | 997 "/gaim/gtk/conversations/tab_side", |
998 _("Top"), GTK_POS_TOP, | |
999 _("Bottom"), GTK_POS_BOTTOM, | |
1000 _("Left"), GTK_POS_LEFT, | |
1001 _("Right"), GTK_POS_RIGHT, | |
1002 NULL); | |
1003 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1004 gtk_size_group_add_widget(sg, label); | |
1005 | |
9155 | 1006 names = gaim_conv_placement_get_options(); |
9251 | 1007 label = gaim_gtk_prefs_dropdown_from_list(vbox2, _("New conversation _placement:"), |
9155 | 1008 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); |
1009 gtk_size_group_add_widget(sg, label); | |
1010 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1011 g_list_free(names); | |
1012 | |
5440 | 1013 gtk_widget_show_all(ret); |
1014 | |
1015 return ret; | |
1016 } | |
1017 | |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1018 static void network_ip_changed(GtkEntry *entry, gpointer data) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1019 { |
8834 | 1020 gaim_network_set_public_ip(gtk_entry_get_text(entry)); |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1021 } |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1022 |
9150 | 1023 static void |
1024 proxy_changed_cb(const char *name, GaimPrefType type, gpointer value, | |
1025 gpointer data) | |
1026 { | |
1027 GtkWidget *frame = data; | |
1028 const char *proxy = value; | |
1029 | |
1030 if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) | |
1031 gtk_widget_set_sensitive(frame, TRUE); | |
1032 else | |
1033 gtk_widget_set_sensitive(frame, FALSE); | |
1034 } | |
1035 | |
1036 static void proxy_print_option(GtkEntry *entry, int entrynum) | |
1037 { | |
1038 if (entrynum == PROXYHOST) | |
1039 gaim_prefs_set_string("/core/proxy/host", gtk_entry_get_text(entry)); | |
1040 else if (entrynum == PROXYPORT) | |
1041 gaim_prefs_set_int("/core/proxy/port", atoi(gtk_entry_get_text(entry))); | |
1042 else if (entrynum == PROXYUSER) | |
1043 gaim_prefs_set_string("/core/proxy/username", gtk_entry_get_text(entry)); | |
1044 else if (entrynum == PROXYPASS) | |
1045 gaim_prefs_set_string("/core/proxy/password", gtk_entry_get_text(entry)); | |
1046 } | |
1047 | |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1048 GtkWidget *network_page() { |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1049 GtkWidget *ret; |
9150 | 1050 GtkWidget *vbox, *hbox, *entry; |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1051 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1052 GtkSizeGroup *sg; |
9150 | 1053 GaimProxyInfo *proxy_info; |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1054 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1055 ret = gtk_vbox_new(FALSE, 18); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1056 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); |
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 vbox = gaim_gtk_make_frame (ret, _("IP Address")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1059 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1060 auto_ip_checkbox = gaim_gtk_prefs_checkbox(_("_Autodetect IP Address"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1061 "/core/network/auto_ip", vbox); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1062 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1063 table = gtk_table_new(2, 1, FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1064 gtk_container_set_border_width(GTK_CONTAINER(table), 5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1065 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1066 gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1067 gtk_container_add(GTK_CONTAINER(vbox), table); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1068 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1069 label = gtk_label_new_with_mnemonic(_("Public _IP:")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1070 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1071 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
|
1072 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1073 entry = gtk_entry_new(); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1074 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1075 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
|
1076 g_signal_connect(G_OBJECT(entry), "changed", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1077 G_CALLBACK(network_ip_changed), NULL); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1078 |
8834 | 1079 if (gaim_network_get_public_ip() != NULL) |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1080 gtk_entry_set_text(GTK_ENTRY(entry), |
8834 | 1081 gaim_network_get_public_ip()); |
8231
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 gaim_set_accessible_label (entry, label); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1084 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1085 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1086 if (gaim_prefs_get_bool("/core/network/auto_ip")) { |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1087 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
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 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1090 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1091 G_CALLBACK(gaim_gtk_toggle_sensitive), table); |
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 vbox = gaim_gtk_make_frame (ret, _("Ports")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1094 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
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 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
|
1097 "/core/network/ports_range_use", vbox); |
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 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_Start Port:"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1100 "/core/network/ports_range_start", 0, 65535, sg); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1101 if (!gaim_prefs_get_bool("/core/network/ports_range_use")) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1102 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1103 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1104 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1105 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1106 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_End Port:"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1107 "/core/network/ports_range_end", 0, 65535, sg); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1108 if (!gaim_prefs_get_bool("/core/network/ports_range_use")) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1109 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1110 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1111 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1112 |
9150 | 1113 vbox = gaim_gtk_make_frame(ret, _("Proxy Server")); |
1114 prefs_proxy_frame = gtk_vbox_new(FALSE, 0); | |
7987 | 1115 gaim_gtk_prefs_dropdown(vbox, _("Proxy _type:"), GAIM_PREF_STRING, |
9150 | 1116 "/core/proxy/type", |
1117 _("No proxy"), "none", | |
1118 "SOCKS 4", "socks4", | |
1119 "SOCKS 5", "socks5", | |
1120 "HTTP", "http", | |
1121 _("Use Environmental Settings"), "envvar", | |
1122 NULL); | |
1123 gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1124 proxy_info = gaim_global_proxy_get_info(); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1125 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1126 if (proxy_info == NULL || |
6621 | 1127 gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_NONE || |
1128 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
|
1129 |
6001 | 1130 gtk_widget_set_sensitive(GTK_WIDGET(prefs_proxy_frame), FALSE); |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1131 } |
10087 | 1132 gaim_prefs_connect_callback(prefs, "/core/proxy/type", |
1133 proxy_changed_cb, prefs_proxy_frame); | |
9150 | 1134 |
1135 table = gtk_table_new(4, 2, FALSE); | |
5440 | 1136 gtk_container_set_border_width(GTK_CONTAINER(table), 5); |
1137 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
1138 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
9150 | 1139 gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table); |
5440 | 1140 |
1141 | |
7797 | 1142 label = gtk_label_new_with_mnemonic(_("_Host:")); |
5440 | 1143 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
1144 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1145 | |
1146 entry = gtk_entry_new(); | |
1147 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1148 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
1149 g_signal_connect(G_OBJECT(entry), "changed", | |
1150 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1151 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1152 if (proxy_info != NULL && gaim_proxy_info_get_host(proxy_info)) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1153 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1154 gaim_proxy_info_get_host(proxy_info)); |
5440 | 1155 |
1156 hbox = gtk_hbox_new(TRUE, 5); | |
1157 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
8137 | 1158 gaim_set_accessible_label (entry, label); |
5440 | 1159 |
7870 | 1160 label = gtk_label_new_with_mnemonic(_("_Port:")); |
5440 | 1161 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
9150 | 1162 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); |
5440 | 1163 |
1164 entry = gtk_entry_new(); | |
1165 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
9150 | 1166 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); |
5440 | 1167 g_signal_connect(G_OBJECT(entry), "changed", |
1168 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
1169 | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1170 if (proxy_info != NULL && gaim_proxy_info_get_port(proxy_info) != 0) { |
5440 | 1171 char buf[128]; |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1172 g_snprintf(buf, sizeof(buf), "%d", |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1173 gaim_proxy_info_get_port(proxy_info)); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1174 |
5440 | 1175 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
1176 } | |
8137 | 1177 gaim_set_accessible_label (entry, label); |
5440 | 1178 |
7797 | 1179 label = gtk_label_new_with_mnemonic(_("_User:")); |
5440 | 1180 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
9150 | 1181 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); |
5440 | 1182 |
1183 entry = gtk_entry_new(); | |
1184 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
9150 | 1185 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
5440 | 1186 g_signal_connect(G_OBJECT(entry), "changed", |
1187 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1188 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1189 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
|
1190 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1191 gaim_proxy_info_get_username(proxy_info)); |
5440 | 1192 |
1193 hbox = gtk_hbox_new(TRUE, 5); | |
1194 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
8137 | 1195 gaim_set_accessible_label (entry, label); |
5440 | 1196 |
7797 | 1197 label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
5440 | 1198 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
9150 | 1199 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); |
5440 | 1200 |
1201 entry = gtk_entry_new(); | |
1202 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
9150 | 1203 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); |
5440 | 1204 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
1205 g_signal_connect(G_OBJECT(entry), "changed", | |
1206 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1207 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1208 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
|
1209 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1210 gaim_proxy_info_get_password(proxy_info)); |
8137 | 1211 gaim_set_accessible_label (entry, label); |
5440 | 1212 |
1213 gtk_widget_show_all(ret); | |
1214 return ret; | |
1215 } | |
1216 | |
1217 #ifndef _WIN32 | |
1218 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
1219 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1220 | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1221 gaim_prefs_set_string("/gaim/gtk/browsers/command", program); |
5440 | 1222 |
1223 /* carry on normally */ | |
1224 return FALSE; | |
1225 } | |
1226 | |
5633 | 1227 static GList *get_available_browsers() |
5440 | 1228 { |
1229 struct browser { | |
1230 char *name; | |
1231 char *command; | |
1232 }; | |
1233 | |
1234 static struct browser possible_browsers[] = { | |
9405 | 1235 {N_("Epiphany"), "epiphany"}, |
8267 | 1236 {N_("Firebird"), "mozilla-firebird"}, |
8356 | 1237 {N_("Firefox"), "firefox"}, |
9405 | 1238 {N_("Galeon"), "galeon"}, |
1239 {N_("Gnome Default"), "gnome-open"}, | |
1240 {N_("Konqueror"), "kfmclient"}, | |
1241 {N_("Mozilla"), "mozilla"}, | |
1242 {N_("Netscape"), "netscape"}, | |
1243 {N_("Opera"), "opera"} | |
5440 | 1244 }; |
9405 | 1245 static const int num_possible_browsers = 9; |
5440 | 1246 |
1247 GList *browsers = NULL; | |
1248 int i = 0; | |
5819 | 1249 char *browser_setting = (char *)gaim_prefs_get_string("/gaim/gtk/browsers/browser"); |
5440 | 1250 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1251 browsers = g_list_prepend(browsers, "custom"); |
5440 | 1252 browsers = g_list_prepend(browsers, _("Manual")); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1253 |
5440 | 1254 for (i = 0; i < num_possible_browsers; i++) { |
7108
6faeeecab0dc
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1255 if (gaim_program_is_valid(possible_browsers[i].command)) { |
5633 | 1256 browsers = g_list_prepend(browsers, |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1257 possible_browsers[i].command); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1258 browsers = g_list_prepend(browsers, _(possible_browsers[i].name)); |
5825 | 1259 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
5819 | 1260 browser_setting = NULL; |
5440 | 1261 } |
1262 } | |
1263 | |
5819 | 1264 if(browser_setting) |
1265 gaim_prefs_set_string("/gaim/gtk/browsers/browser", "custom"); | |
1266 | |
5440 | 1267 return browsers; |
1268 } | |
1269 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1270 static void |
8274 | 1271 browser_changed1_cb(const char *name, GaimPrefType type, gpointer value, |
1272 gpointer data) | |
1273 { | |
1274 GtkWidget *hbox = data; | |
1275 const char *browser = value; | |
1276 | |
1277 gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); | |
1278 } | |
1279 | |
1280 static void | |
1281 browser_changed2_cb(const char *name, GaimPrefType type, gpointer value, | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1282 gpointer data) |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1283 { |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1284 GtkWidget *hbox = data; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1285 const char *browser = value; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1286 |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1287 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1288 } |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1289 |
5440 | 1290 GtkWidget *browser_page() { |
1291 GtkWidget *ret; | |
1292 GtkWidget *vbox; | |
1293 GtkWidget *hbox; | |
1294 GtkWidget *label; | |
6007 | 1295 GtkWidget *entry; |
5440 | 1296 GtkSizeGroup *sg; |
1297 GList *browsers = NULL; | |
1298 | |
1299 ret = gtk_vbox_new(FALSE, 18); | |
1300 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1301 | |
1302 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1303 vbox = gaim_gtk_make_frame (ret, _("Browser Selection")); |
5440 | 1304 |
1305 browsers = get_available_browsers(); | |
1306 if (browsers != NULL) { | |
7987 | 1307 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
|
1308 "/gaim/gtk/browsers/browser", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1309 browsers); |
5440 | 1310 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
1311 gtk_size_group_add_widget(sg, label); | |
8274 | 1312 |
1313 hbox = gtk_hbox_new(FALSE, 0); | |
1314 label = gaim_gtk_prefs_dropdown(hbox, _("_Open link in:"), GAIM_PREF_INT, | |
1315 "/gaim/gtk/browsers/place", | |
1316 _("Browser default"), GAIM_BROWSER_DEFAULT, | |
1317 _("Existing window"), GAIM_BROWSER_CURRENT, | |
1318 _("New window"), GAIM_BROWSER_NEW_WINDOW, | |
1319 _("New tab"), GAIM_BROWSER_NEW_TAB, | |
1320 NULL); | |
1321 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1322 gtk_size_group_add_widget(sg, label); | |
1323 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1324 | |
1325 if (!strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) | |
1326 gtk_widget_set_sensitive(hbox, FALSE); | |
10087 | 1327 gaim_prefs_connect_callback(prefs, "/gaim/gtk/browsers/browser", |
1328 browser_changed1_cb, hbox); | |
5440 | 1329 } |
1330 | |
1331 hbox = gtk_hbox_new(FALSE, 5); | |
1332 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
6031 | 1333 label = gtk_label_new_with_mnemonic(_("_Manual:\n(%s for URL)")); |
5440 | 1334 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
1335 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1336 gtk_size_group_add_widget(sg, label); | |
1337 | |
6007 | 1338 entry = gtk_entry_new(); |
1339 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1340 |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1341 if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) |
5440 | 1342 gtk_widget_set_sensitive(hbox, FALSE); |
10087 | 1343 gaim_prefs_connect_callback(prefs, "/gaim/gtk/browsers/browser", |
1344 browser_changed2_cb, hbox); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1345 |
6007 | 1346 gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); |
1347 | |
1348 gtk_entry_set_text(GTK_ENTRY(entry), | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1349 gaim_prefs_get_string("/gaim/gtk/browsers/command")); |
6007 | 1350 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1351 G_CALLBACK(manual_browser_set), NULL); |
8188
cd9ea20cd8ed
[gaim-migrate @ 8909]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
1352 gaim_set_accessible_label (entry, label); |
5440 | 1353 |
1354 gtk_widget_show_all(ret); | |
1355 return ret; | |
1356 } | |
1357 #endif /*_WIN32*/ | |
1358 | |
1359 GtkWidget *logging_page() { | |
1360 GtkWidget *ret; | |
1361 GtkWidget *vbox; | |
7431 | 1362 GList *names; |
8573 | 1363 GtkWidget *sys_box; |
1364 GtkWidget *box; | |
1365 int syslog_enabled = gaim_prefs_get_bool("/core/logging/log_system"); | |
1366 | |
5440 | 1367 ret = gtk_vbox_new(FALSE, 18); |
1368 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1369 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1370 vbox = gaim_gtk_make_frame (ret, _("Message Logs")); |
7431 | 1371 names = gaim_log_logger_get_options(); |
1372 | |
7987 | 1373 gaim_gtk_prefs_dropdown_from_list(vbox, _("Log _Format:"), GAIM_PREF_STRING, |
1374 "/core/logging/format", names); | |
1375 | |
1376 gaim_gtk_prefs_checkbox(_("_Log all instant messages"), | |
7562
b859cfb5f31a
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1377 "/core/logging/log_ims", vbox); |
7987 | 1378 gaim_gtk_prefs_checkbox(_("Log all c_hats"), |
7562
b859cfb5f31a
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1379 "/core/logging/log_chats", vbox); |
8573 | 1380 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1381 vbox = gaim_gtk_make_frame (ret, _("System Logs")); |
8573 | 1382 |
1383 sys_box = gaim_gtk_prefs_checkbox(_("_Enable system log"), | |
1384 "/core/logging/log_system", vbox); | |
1385 | |
1386 box = gaim_gtk_prefs_checkbox(_("Log when buddies _sign on/sign off"), | |
1387 "/core/logging/log_signon_signoff", vbox); | |
1388 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1389 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1390 gtk_widget_set_sensitive(box, syslog_enabled); | |
1391 | |
1392 box = gaim_gtk_prefs_checkbox(_("Log when buddies become _idle/un-idle"), | |
1393 "/core/logging/log_idle_state", vbox); | |
1394 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1395 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1396 gtk_widget_set_sensitive(box, syslog_enabled); | |
1397 | |
1398 box = gaim_gtk_prefs_checkbox(_("Log when buddies go away/come _back"), | |
1399 "/core/logging/log_away_state", vbox); | |
1400 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1401 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1402 gtk_widget_set_sensitive(box, syslog_enabled); | |
1403 | |
1404 box = gaim_gtk_prefs_checkbox(_("Log your _own signons/idleness/awayness"), | |
1405 "/core/logging/log_own_states", vbox); | |
1406 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1407 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1408 gtk_widget_set_sensitive(box, syslog_enabled); | |
1409 | |
5440 | 1410 gtk_widget_show_all(ret); |
1411 return ret; | |
1412 } | |
1413 | |
1414 #ifndef _WIN32 | |
1415 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
1416 { | |
5684 | 1417 gaim_prefs_set_string("/gaim/gtk/sound/command", |
6007 | 1418 gtk_entry_get_text(GTK_ENTRY(entry))); |
5440 | 1419 return TRUE; |
1420 } | |
6005 | 1421 |
1422 static void | |
10074 | 1423 sound_changed1_cb(const char *name, GaimPrefType type, gpointer value, |
6005 | 1424 gpointer data) |
1425 { | |
1426 GtkWidget *hbox = data; | |
1427 const char *method = value; | |
1428 | |
1429 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); | |
1430 } | |
10074 | 1431 |
1432 static void | |
1433 sound_changed2_cb(const char *name, GaimPrefType type, gpointer value, | |
1434 gpointer data) | |
1435 { | |
1436 GtkWidget *vbox = data; | |
1437 const char *method = value; | |
1438 | |
1439 gtk_widget_set_sensitive(vbox, strcmp(method, "none")); | |
1440 } | |
5440 | 1441 #endif |
1442 | |
9150 | 1443 |
1444 static void | |
1445 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1446 { | |
1447 GtkTreeModel *model = (GtkTreeModel *)data; | |
1448 GtkTreeIter iter; | |
1449 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1450 const char *pref; | |
1451 | |
1452 gtk_tree_model_get_iter (model, &iter, path); | |
1453 gtk_tree_model_get (model, &iter, | |
1454 2, &pref, | |
1455 -1); | |
1456 | |
1457 gaim_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); | |
1458 | |
1459 gtk_list_store_set(GTK_LIST_STORE (model), &iter, | |
1460 0, !gtk_cell_renderer_toggle_get_active(cell), | |
1461 -1); | |
1462 | |
1463 gtk_tree_path_free(path); | |
1464 } | |
1465 | |
1466 static void | |
1467 test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1468 { | |
1469 char *pref; | |
1470 gboolean temp_value1, temp_value2; | |
1471 | |
1472 pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", | |
1473 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
1474 | |
1475 temp_value1 = gaim_prefs_get_bool("/core/sound/while_away"); | |
1476 temp_value2 = gaim_prefs_get_bool(pref); | |
1477 | |
1478 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", TRUE); | |
1479 if (!temp_value2) gaim_prefs_set_bool(pref, TRUE); | |
1480 | |
1481 gaim_sound_play_event(sound_row_sel); | |
1482 | |
1483 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", FALSE); | |
1484 if (!temp_value2) gaim_prefs_set_bool(pref, FALSE); | |
1485 | |
1486 g_free(pref); | |
1487 } | |
1488 | |
9508 | 1489 /* |
1490 * Resets a sound file back to default. | |
1491 */ | |
9150 | 1492 static void |
1493 reset_sound(GtkWidget *button, gpointer i_am_also_NULL) | |
1494 { | |
9508 | 1495 gchar *pref; |
1496 | |
1497 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1498 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
9150 | 1499 gaim_prefs_set_string(pref, ""); |
1500 g_free(pref); | |
1501 | |
1502 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); | |
1503 } | |
1504 | |
9508 | 1505 static void |
1506 sound_chosen_cb(void *user_data, const char *filename) | |
9150 | 1507 { |
9508 | 1508 gchar *pref; |
1509 int sound; | |
1510 | |
1511 sound = GPOINTER_TO_INT(user_data); | |
9150 | 1512 |
1513 /* Set it -- and forget it */ | |
1514 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
9508 | 1515 gaim_gtk_sound_get_event_option(sound)); |
1516 gaim_prefs_set_string(pref, filename); | |
9150 | 1517 g_free(pref); |
1518 | |
9508 | 1519 /* |
1520 * If the sound we just changed is still the currently selected | |
1521 * sound, then update the box showing the file name. | |
1522 */ | |
1523 if (sound == sound_row_sel) | |
1524 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); | |
9150 | 1525 } |
1526 | |
9508 | 1527 static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
9150 | 1528 { |
9508 | 1529 gchar *pref; |
1530 const char *filename; | |
1531 | |
1532 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1533 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
1534 filename = gaim_prefs_get_string(pref); | |
1535 g_free(pref); | |
1536 | |
1537 if (*filename == '\0') | |
1538 filename = NULL; | |
1539 | |
1540 gaim_request_file(prefs, _("Sound Selection"), filename, FALSE, | |
1541 G_CALLBACK(sound_chosen_cb), NULL, GINT_TO_POINTER(sound_row_sel)); | |
9150 | 1542 } |
1543 | |
9508 | 1544 static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
9150 | 1545 GtkTreeIter iter; |
1546 GValue val = { 0, }; | |
1547 const char *file; | |
1548 char *pref; | |
1549 | |
1550 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1551 return; | |
1552 gtk_tree_model_get_value (model, &iter, 3, &val); | |
1553 sound_row_sel = g_value_get_uint(&val); | |
1554 | |
1555 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1556 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
1557 file = gaim_prefs_get_string(pref); | |
1558 g_free(pref); | |
1559 if (sound_entry) | |
1560 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); | |
1561 g_value_unset (&val); | |
1562 } | |
1563 | |
5440 | 1564 GtkWidget *sound_page() { |
1565 GtkWidget *ret; | |
9150 | 1566 GtkWidget *vbox, *sw, *button; |
5440 | 1567 GtkSizeGroup *sg; |
9150 | 1568 GtkTreeIter iter; |
1569 GtkWidget *event_view; | |
1570 GtkListStore *event_store; | |
1571 GtkCellRenderer *rend; | |
1572 GtkTreeViewColumn *col; | |
1573 GtkTreeSelection *sel; | |
1574 GtkTreePath *path; | |
1575 GtkWidget *hbox; | |
1576 int j; | |
1577 const char *file; | |
1578 char *pref; | |
5440 | 1579 #ifndef _WIN32 |
1580 GtkWidget *dd; | |
1581 GtkWidget *label; | |
6007 | 1582 GtkWidget *entry; |
5684 | 1583 const char *cmd; |
5440 | 1584 #endif |
1585 | |
1586 ret = gtk_vbox_new(FALSE, 18); | |
1587 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1588 | |
1589 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1590 | |
1591 #ifndef _WIN32 | |
6033 | 1592 vbox = gaim_gtk_make_frame (ret, _("Sound Method")); |
7987 | 1593 dd = gaim_gtk_prefs_dropdown(vbox, _("_Method:"), GAIM_PREF_STRING, |
1594 "/gaim/gtk/sound/method", | |
1595 _("Console beep"), "beep", | |
5440 | 1596 #ifdef USE_AO |
7987 | 1597 _("Automatic"), "automatic", |
1598 "ESD", "esd", | |
1599 "Arts", "arts", | |
5440 | 1600 #endif |
1601 #ifdef USE_NAS_AUDIO | |
7987 | 1602 "NAS", "nas", |
5440 | 1603 #endif |
7987 | 1604 _("Command"), "custom", |
10074 | 1605 _("No sounds"), "none", |
7987 | 1606 NULL); |
5440 | 1607 gtk_size_group_add_widget(sg, dd); |
1608 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1609 | |
1610 hbox = gtk_hbox_new(FALSE, 5); | |
1611 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1612 | |
6031 | 1613 label = gtk_label_new_with_mnemonic(_("Sound c_ommand:\n(%s for filename)")); |
5440 | 1614 gtk_size_group_add_widget(sg, label); |
1615 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1616 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1617 | |
6007 | 1618 entry = gtk_entry_new(); |
1619 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1620 | |
1621 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); | |
5684 | 1622 cmd = gaim_prefs_get_string("/gaim/gtk/sound/command"); |
5440 | 1623 if(cmd) |
6007 | 1624 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
1625 gtk_widget_set_size_request(entry, 75, -1); | |
1626 | |
1627 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5); | |
1628 g_signal_connect(G_OBJECT(entry), "changed", | |
5440 | 1629 G_CALLBACK(sound_cmd_yeah), NULL); |
6005 | 1630 |
1631 gtk_widget_set_sensitive(hbox, | |
1632 !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), | |
1633 "custom")); | |
10087 | 1634 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method", |
1635 sound_changed1_cb, hbox); | |
6005 | 1636 |
8141 | 1637 gaim_set_accessible_label (entry, label); |
5440 | 1638 #endif /* _WIN32 */ |
9150 | 1639 |
10074 | 1640 vbox = gaim_gtk_make_frame (ret, _("Sound Options")); |
1641 gaim_gtk_prefs_checkbox(_("Sounds when conversation has _focus"), | |
1642 "/gaim/gtk/sound/conv_focus", vbox); | |
1643 gaim_gtk_prefs_checkbox(_("_Sounds while away"), | |
1644 "/core/sound/while_away", vbox); | |
1645 | |
10075 | 1646 #ifndef _WIN32 |
10074 | 1647 gtk_widget_set_sensitive(vbox, |
1648 strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), "none")); | |
10087 | 1649 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method", |
1650 sound_changed2_cb, vbox); | |
10075 | 1651 #endif |
10074 | 1652 |
9150 | 1653 vbox = gaim_gtk_make_frame(ret, _("Sound Events")); |
1654 | |
1655 /* The following is an ugly hack to make the frame expand so the | |
1656 * sound events list is big enough to be usable */ | |
1657 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, | |
1658 GTK_PACK_START); | |
1659 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, | |
1660 TRUE, 0, GTK_PACK_START); | |
1661 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), | |
1662 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); | |
1663 | |
1664 sw = gtk_scrolled_window_new(NULL,NULL); | |
1665 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
1666 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1667 | |
1668 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
1669 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); | |
1670 | |
1671 for (j=0; j < GAIM_NUM_SOUNDS; j++) { | |
1672 char *pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", | |
1673 gaim_gtk_sound_get_event_option(j)); | |
1674 const char *label = gaim_gtk_sound_get_event_label(j); | |
1675 | |
1676 if (label == NULL) { | |
1677 g_free(pref); | |
1678 continue; | |
1679 } | |
1680 | |
1681 gtk_list_store_append (event_store, &iter); | |
1682 gtk_list_store_set(event_store, &iter, | |
1683 0, gaim_prefs_get_bool(pref), | |
1684 1, _(label), | |
1685 2, pref, | |
1686 3, j, | |
1687 -1); | |
1688 g_free(pref); | |
1689 } | |
1690 | |
1691 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
1692 | |
1693 rend = gtk_cell_renderer_toggle_new(); | |
1694 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1695 g_signal_connect (G_OBJECT (sel), "changed", | |
1696 G_CALLBACK (prefs_sound_sel), | |
1697 NULL); | |
1698 g_signal_connect (G_OBJECT(rend), "toggled", | |
1699 G_CALLBACK(event_toggled), event_store); | |
1700 path = gtk_tree_path_new_first(); | |
1701 gtk_tree_selection_select_path(sel, path); | |
1702 gtk_tree_path_free(path); | |
1703 | |
1704 col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
1705 rend, | |
1706 "active", 0, | |
1707 NULL); | |
1708 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1709 | |
1710 rend = gtk_cell_renderer_text_new(); | |
1711 col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
1712 rend, | |
1713 "text", 1, | |
1714 NULL); | |
1715 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1716 g_object_unref(G_OBJECT(event_store)); | |
1717 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1718 | |
1719 hbox = gtk_hbox_new(FALSE, 6); | |
1720 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1721 sound_entry = gtk_entry_new(); | |
1722 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1723 gaim_gtk_sound_get_event_option(0)); | |
1724 file = gaim_prefs_get_string(pref); | |
1725 g_free(pref); | |
1726 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); | |
1727 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); | |
1728 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
1729 | |
1730 button = gtk_button_new_with_label(_("Test")); | |
1731 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
1732 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1733 | |
1734 button = gtk_button_new_with_label(_("Reset")); | |
1735 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
1736 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1737 | |
1738 button = gtk_button_new_with_label(_("Choose...")); | |
9508 | 1739 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
9150 | 1740 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
5440 | 1741 gtk_widget_show_all(ret); |
9118 | 1742 |
10075 | 1743 #ifndef _WIN32 |
10074 | 1744 gtk_widget_set_sensitive(vbox, |
1745 strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), "none")); | |
10087 | 1746 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method", |
1747 sound_changed2_cb, vbox); | |
10075 | 1748 #endif |
10074 | 1749 |
5440 | 1750 return ret; |
1751 } | |
1752 | |
1753 GtkWidget *away_page() { | |
1754 GtkWidget *ret; | |
1755 GtkWidget *vbox; | |
1756 GtkWidget *hbox; | |
1757 GtkWidget *label; | |
1758 GtkWidget *button; | |
1759 GtkWidget *select; | |
1760 GtkWidget *dd; | |
1761 GtkSizeGroup *sg; | |
1762 | |
1763 ret = gtk_vbox_new(FALSE, 18); | |
1764 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1765 | |
1766 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1767 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1768 vbox = gaim_gtk_make_frame (ret, _("Away")); |
7987 | 1769 gaim_gtk_prefs_checkbox(_("_Queue new messages when away"), |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
1770 "/gaim/gtk/away/queue_messages", vbox); |
5440 | 1771 |
9596 | 1772 label = gaim_gtk_prefs_dropdown(vbox, _("_Auto-reply:"), |
1773 GAIM_PREF_STRING, "/core/away/auto_reply", | |
1774 _("Never"), "never", | |
9736 | 1775 _("When away"), "away", |
1776 _("When away and idle"), "awayidle", | |
9596 | 1777 NULL); |
6142 | 1778 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1779 vbox = gaim_gtk_make_frame (ret, _("Idle")); |
7987 | 1780 dd = gaim_gtk_prefs_dropdown(vbox, _("Idle _time reporting:"), |
1781 GAIM_PREF_STRING, "/gaim/gtk/idle/reporting_method", | |
1782 _("None"), "none", | |
1783 _("Gaim usage"), "gaim", | |
5440 | 1784 #ifdef USE_SCREENSAVER |
1785 #ifndef _WIN32 | |
7987 | 1786 _("X usage"), "system", |
5440 | 1787 #else |
7987 | 1788 _("Windows usage"), "system", |
5440 | 1789 #endif |
1790 #endif | |
7987 | 1791 NULL); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1792 |
5440 | 1793 gtk_size_group_add_widget(sg, dd); |
1794 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1795 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1796 vbox = gaim_gtk_make_frame (ret, _("Auto-away")); |
7987 | 1797 button = gaim_gtk_prefs_checkbox(_("Set away _when idle"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1798 "/core/away/away_when_idle", vbox); |
8238 | 1799 |
7987 | 1800 select = gaim_gtk_prefs_labeled_spin_button(vbox, |
1801 _("_Minutes before setting away:"), "/core/away/mins_before_away", | |
1802 1, 24 * 60, sg); | |
5440 | 1803 g_signal_connect(G_OBJECT(button), "clicked", |
1804 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
1805 | |
8238 | 1806 hbox = gtk_hbox_new(FALSE, 0); |
1807 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1808 | |
5440 | 1809 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
1810 gtk_size_group_add_widget(sg, label); | |
1811 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
8238 | 1812 g_signal_connect(G_OBJECT(button), "clicked", |
1813 G_CALLBACK(gaim_gtk_toggle_sensitive), label); | |
5440 | 1814 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
8238 | 1815 |
5440 | 1816 prefs_away_menu = gtk_option_menu_new(); |
1817 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); | |
1818 g_signal_connect(G_OBJECT(button), "clicked", | |
1819 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); | |
1820 default_away_menu_init(prefs_away_menu); | |
1821 gtk_widget_show(prefs_away_menu); | |
1822 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
8238 | 1823 gaim_set_accessible_label (prefs_away_menu, label); |
1824 | |
5440 | 1825 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1826 if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1827 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
8238 | 1828 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1829 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1830 } |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1831 |
5440 | 1832 gtk_widget_show_all(ret); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1833 |
5440 | 1834 return ret; |
1835 } | |
1836 | |
1837 static GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
1838 | |
1839 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
1840 { | |
1841 gchar *buf, *pname, *perr, *pdesc, *pauth, *pweb; | |
1842 GtkTreeIter iter; | |
1843 GValue val = { 0, }; | |
1844 GaimPlugin *plug; | |
1845 | |
1846 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1847 return; | |
8104 | 1848 gtk_tree_model_get_value (model, &iter, 3, &val); |
5440 | 1849 plug = g_value_get_pointer(&val); |
8998 | 1850 |
5440 | 1851 pname = g_markup_escape_text(_(plug->info->name), -1); |
9307 | 1852 pdesc = (plug->info->description) ? |
1853 g_markup_escape_text(_(plug->info->description), -1) : NULL; | |
1854 pauth = (plug->info->author) ? | |
1855 g_markup_escape_text(_(plug->info->author), -1) : NULL; | |
1856 pweb = (plug->info->homepage) ? | |
1857 g_markup_escape_text(_(plug->info->homepage), -1) : NULL; | |
1858 | |
5440 | 1859 if (plug->error != NULL) { |
1860 perr = g_markup_escape_text(_(plug->error), -1); | |
1861 buf = g_strdup_printf( | |
1862 "<span size=\"larger\">%s %s</span>\n\n" | |
1863 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1864 "%s", | |
1865 pname, plug->info->version, perr, pdesc); | |
1866 g_free(perr); | |
1867 } | |
1868 else { | |
1869 buf = g_strdup_printf( | |
1870 "<span size=\"larger\">%s %s</span>\n\n%s", | |
1871 pname, plug->info->version, pdesc); | |
1872 } | |
1873 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1874 g_free(buf); | |
1875 | |
1876 buf = g_strdup_printf( | |
1877 #ifndef _WIN32 | |
1878 _("<span size=\"larger\">%s %s</span>\n\n" | |
1879 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
1880 "<span weight=\"bold\">Web site:</span>\t\t%s\n" | |
1881 "<span weight=\"bold\">File name:</span>\t%s"), | |
1882 #else | |
1883 _("<span size=\"larger\">%s %s</span>\n\n" | |
1884 "<span weight=\"bold\">Written by:</span> %s\n" | |
1885 "<span weight=\"bold\">URL:</span> %s\n" | |
1886 "<span weight=\"bold\">File name:</span> %s"), | |
1887 #endif | |
1888 pname, plug->info->version, pauth, pweb, plug->path); | |
1889 | |
1890 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
1891 g_value_unset(&val); | |
1892 g_free(buf); | |
1893 g_free(pname); | |
1894 g_free(pdesc); | |
1895 g_free(pauth); | |
1896 g_free(pweb); | |
1897 } | |
1898 | |
1899 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1900 { | |
1901 GtkTreeModel *model = (GtkTreeModel *)data; | |
1902 GtkTreeIter iter; | |
1903 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1904 GaimPlugin *plug; | |
1905 gchar buf[1024]; | |
6040 | 1906 gchar *name = NULL, *description = NULL; |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1907 |
5440 | 1908 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1909 gdk_window_set_cursor(prefs->window, wait); | |
1910 gdk_cursor_unref(wait); | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1911 |
5440 | 1912 gtk_tree_model_get_iter (model, &iter, path); |
8104 | 1913 gtk_tree_model_get (model, &iter, 3, &plug, -1); |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1914 |
5440 | 1915 if (!gaim_plugin_is_loaded(plug)) { |
1916 gaim_plugin_load(plug); | |
1917 | |
1918 /* | |
1919 * NOTE: This is basically the same check as before | |
1920 * (plug->type == plugin), but now there aren't plugin types. | |
1921 * Not yet, anyway. I want to do a V2 of the plugin API. | |
1922 * The thing is, we should have a flag specifying the UI type, | |
1923 * or just whether it's a general plugin or a UI-specific | |
1924 * plugin. We should only load this if it's UI-specific. | |
1925 * | |
1926 * -- ChipX86 | |
1927 */ | |
1928 if (GAIM_IS_GTK_PLUGIN(plug)) | |
1929 { | |
1930 GtkWidget *config_frame; | |
1931 GaimGtkPluginUiInfo *ui_info; | |
1932 | |
1933 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1934 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
1935 | |
1936 if (config_frame != NULL) { | |
1937 ui_info->iter = g_new0(GtkTreeIter, 1); | |
1938 prefs_notebook_add_page(_(plug->info->name), NULL, | |
10078 | 1939 config_frame, ui_info->iter, |
1940 &plugin_iter, notebook_page++); | |
5440 | 1941 } |
1942 } | |
8713 | 1943 |
1944 if(GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { | |
8998 | 1945 GtkTreeIter iter; |
8713 | 1946 GtkWidget *pref_frame; |
1947 GaimPluginUiInfo *prefs_info; | |
1948 | |
1949 if(plug->info->type == GAIM_PLUGIN_PROTOCOL) | |
1950 iter = proto_iter; | |
1951 else | |
1952 iter = plugin_iter; | |
1953 | |
1954 prefs_info = GAIM_PLUGIN_UI_INFO(plug); | |
8814 | 1955 prefs_info->frame = prefs_info->get_plugin_pref_frame(plug); |
1956 pref_frame = gaim_gtk_plugin_pref_create_frame(prefs_info->frame); | |
8713 | 1957 |
1958 if(pref_frame != NULL) { | |
1959 prefs_info->iter = g_new0(GtkTreeIter, 1); | |
1960 prefs_notebook_add_page(_(plug->info->name), NULL, | |
1961 pref_frame, prefs_info->iter, | |
1962 &iter, notebook_page++); | |
1963 } | |
1964 } | |
5440 | 1965 } |
1966 else { | |
1967 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
1968 GaimGtkPluginUiInfo *ui_info; | |
1969 | |
1970 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1971 | |
1972 if (ui_info != NULL && ui_info->iter != NULL) { | |
1973 g_free(ui_info->iter); | |
1974 ui_info->iter = NULL; | |
1975 } | |
8745 | 1976 } |
1977 | |
1978 if (GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { | |
8713 | 1979 GaimPluginUiInfo *prefs_info; |
1980 | |
1981 prefs_info = GAIM_PLUGIN_UI_INFO(plug); | |
1982 | |
8745 | 1983 if(prefs_info != NULL) { |
8814 | 1984 if(prefs_info->frame != NULL) { |
1985 gaim_plugin_pref_frame_destroy(prefs_info->frame); | |
1986 prefs_info->frame = NULL; | |
1987 } | |
1988 | |
8745 | 1989 if(prefs_info->iter != NULL) { |
1990 g_free(prefs_info->iter); | |
1991 prefs_info->iter = NULL; | |
1992 } | |
8713 | 1993 } |
5440 | 1994 } |
1995 | |
1996 gaim_plugin_unload(plug); | |
1997 } | |
1998 | |
1999 gdk_window_set_cursor(prefs->window, NULL); | |
2000 | |
6040 | 2001 name = g_markup_escape_text(_(plug->info->name), -1); |
2002 description = g_markup_escape_text(_(plug->info->description), -1); | |
5440 | 2003 if (plug->error != NULL) { |
6040 | 2004 gchar *error = g_markup_escape_text(plug->error, -1); |
5440 | 2005 g_snprintf(buf, sizeof(buf), |
2006 "<span size=\"larger\">%s %s</span>\n\n" | |
2007 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
2008 "%s", | |
6040 | 2009 name, plug->info->version, error, description); |
2010 g_free(error); | |
2011 } else { | |
5440 | 2012 g_snprintf(buf, sizeof(buf), |
2013 "<span size=\"larger\">%s %s</span>\n\n%s", | |
6040 | 2014 name, plug->info->version, description); |
5440 | 2015 } |
6040 | 2016 g_free(name); |
2017 g_free(description); | |
5440 | 2018 |
2019 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
2020 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, | |
2021 gaim_plugin_is_loaded(plug), -1); | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2022 |
5440 | 2023 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
2024 gtk_tree_path_free(path); | |
5981
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
2025 |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
2026 gaim_gtk_plugins_save(); |
5440 | 2027 } |
2028 | |
2029 static void | |
2030 update_plugin_list(void *data) | |
2031 { | |
2032 GtkListStore *ls = GTK_LIST_STORE(data); | |
2033 GtkTreeIter iter; | |
2034 GList *probes; | |
2035 GaimPlugin *plug; | |
2036 | |
2037 gtk_list_store_clear(ls); | |
2038 | |
2039 for (probes = gaim_plugins_get_all(); | |
2040 probes != NULL; | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2041 probes = probes->next) |
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2042 { |
5440 | 2043 plug = probes->data; |
2044 | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2045 if (plug->info->type != GAIM_PLUGIN_STANDARD || |
6930
31c45d99e1a8
[gaim-migrate @ 7477]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
2046 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE)) |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2047 { |
5440 | 2048 continue; |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2049 } |
5440 | 2050 |
2051 gtk_list_store_append (ls, &iter); | |
2052 gtk_list_store_set(ls, &iter, | |
2053 0, gaim_plugin_is_loaded(plug), | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2054 1, plug->info->name ? _(plug->info->name) : plug->path, |
8162 | 2055 2, _(plug->info->summary), |
8104 | 2056 3, plug, -1); |
5440 | 2057 } |
2058 } | |
2059 | |
2060 static GtkWidget *plugin_page () | |
2061 { | |
2062 GtkWidget *ret; | |
2063 GtkWidget *sw, *vp; | |
2064 GtkWidget *event_view; | |
2065 GtkListStore *ls; | |
2066 GtkCellRenderer *rend, *rendt; | |
2067 GtkTreeViewColumn *col; | |
2068 GtkTreeSelection *sel; | |
2069 GtkTreePath *path; | |
2070 GtkWidget *nb; | |
2071 | |
2072 ret = gtk_vbox_new(FALSE, 18); | |
2073 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2074 | |
2075 sw = gtk_scrolled_window_new(NULL,NULL); | |
8104 | 2076 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
5440 | 2077 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
2078 | |
2079 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
2080 | |
8104 | 2081 ls = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); |
7939 | 2082 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), |
2083 1, GTK_SORT_ASCENDING); | |
5440 | 2084 |
2085 update_plugin_list(ls); | |
2086 | |
2087 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
2088 | |
2089 rend = gtk_cell_renderer_toggle_new(); | |
2090 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
2091 | |
2092 col = gtk_tree_view_column_new_with_attributes (_("Load"), | |
2093 rend, | |
2094 "active", 0, | |
2095 NULL); | |
2096 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2097 | |
2098 rendt = gtk_cell_renderer_text_new(); | |
2099 col = gtk_tree_view_column_new_with_attributes (_("Name"), | |
2100 rendt, | |
2101 "text", 1, | |
2102 NULL); | |
2103 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
8998 | 2104 |
8104 | 2105 rendt = gtk_cell_renderer_text_new(); |
2106 col = gtk_tree_view_column_new_with_attributes(_("Summary"), | |
2107 rendt, | |
2108 "text", 2, | |
2109 NULL); | |
2110 gtk_tree_view_append_column(GTK_TREE_VIEW(event_view), col); | |
8998 | 2111 |
5440 | 2112 g_object_unref(G_OBJECT(ls)); |
2113 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
8998 | 2114 |
5440 | 2115 |
2116 nb = gtk_notebook_new(); | |
2117 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
2118 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
8998 | 2119 |
5440 | 2120 /* Description */ |
2121 sw = gtk_scrolled_window_new(NULL, NULL); | |
2122 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2123 plugin_description = gtk_label_new(NULL); | |
8998 | 2124 |
5440 | 2125 vp = gtk_viewport_new(NULL, NULL); |
2126 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
2127 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
2128 | |
2129 gtk_container_add(GTK_CONTAINER(vp), plugin_description); | |
2130 gtk_container_add(GTK_CONTAINER(sw), vp); | |
2131 | |
8998 | 2132 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
5440 | 2133 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); |
2134 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); | |
2135 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
2136 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
2137 | |
2138 /* Details */ | |
2139 sw = gtk_scrolled_window_new(NULL, NULL); | |
2140 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2141 plugin_details = gtk_label_new(NULL); | |
8998 | 2142 |
5440 | 2143 vp = gtk_viewport_new(NULL, NULL); |
2144 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
2145 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
2146 | |
2147 gtk_container_add(GTK_CONTAINER(vp), plugin_details); | |
2148 gtk_container_add(GTK_CONTAINER(sw), vp); | |
2149 | |
8998 | 2150 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
5440 | 2151 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); |
2152 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); | |
8998 | 2153 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); |
5440 | 2154 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); |
2155 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
2156 | |
2157 g_signal_connect (G_OBJECT (sel), "changed", | |
2158 G_CALLBACK (prefs_plugin_sel), | |
8998 | 2159 NULL); |
5440 | 2160 g_signal_connect (G_OBJECT(rend), "toggled", |
2161 G_CALLBACK(plugin_load), ls); | |
2162 | |
2163 path = gtk_tree_path_new_first(); | |
2164 gtk_tree_selection_select_path(sel, path); | |
2165 gtk_tree_path_free(path); | |
2166 | |
2167 gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); | |
2168 | |
2169 gtk_widget_show_all(ret); | |
2170 return ret; | |
2171 } | |
2172 | |
2173 GtkTreeIter *prefs_notebook_add_page(const char *text, | |
2174 GdkPixbuf *pixbuf, | |
2175 GtkWidget *page, | |
2176 GtkTreeIter *iter, | |
2177 GtkTreeIter *parent, | |
2178 int ind) { | |
2179 GdkPixbuf *icon = NULL; | |
2180 | |
2181 if (pixbuf) | |
2182 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); | |
2183 | |
2184 if (pixbuf) | |
2185 g_object_unref(pixbuf); | |
2186 if (icon) | |
2187 g_object_unref(icon); | |
2188 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
2189 return iter; | |
2190 } | |
2191 | |
2192 void prefs_notebook_init() { | |
9267 | 2193 GtkTreeIter p, c, c2; |
5440 | 2194 GList *l; |
2195 GaimPlugin *plug; | |
2196 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
2197 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
9150 | 2198 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &c, &p, notebook_page++); |
9267 | 2199 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c2, &c, notebook_page++); |
2200 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c2, &c, notebook_page++); | |
2201 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c2, &c, notebook_page++); | |
9150 | 2202 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &c, &p, notebook_page++); |
8238 | 2203 prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++); |
5440 | 2204 #ifndef _WIN32 |
2205 /* We use the registered default browser in windows */ | |
10060 | 2206 /* if the user is running gnome 2.x, hide the browsers tab */ |
10061 | 2207 if (gaim_running_gnome() == FALSE) { |
10060 | 2208 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
2209 } | |
5440 | 2210 #endif |
2211 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); | |
2212 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
2213 | |
2214 if (gaim_plugins_enabled()) { | |
2215 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); | |
2216 | |
2217 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
8713 | 2218 plug = (GaimPlugin *)l->data; |
5440 | 2219 |
2220 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
2221 GtkWidget *config_frame; | |
2222 GaimGtkPluginUiInfo *ui_info; | |
2223 | |
2224 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
2225 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
2226 | |
2227 if (config_frame != NULL) { | |
2228 ui_info->iter = g_new0(GtkTreeIter, 1); | |
2229 prefs_notebook_add_page(_(plug->info->name), NULL, | |
2230 config_frame, ui_info->iter, | |
2231 &plugin_iter, notebook_page++); | |
2232 } | |
2233 } | |
8713 | 2234 |
2235 if(GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { | |
8745 | 2236 GtkWidget *gtk_frame; |
8713 | 2237 GaimPluginUiInfo *prefs_info; |
2238 | |
2239 prefs_info = GAIM_PLUGIN_UI_INFO(plug); | |
8814 | 2240 prefs_info->frame = prefs_info->get_plugin_pref_frame(plug); |
2241 gtk_frame = gaim_gtk_plugin_pref_create_frame(prefs_info->frame); | |
8745 | 2242 |
2243 if(GTK_IS_WIDGET(gtk_frame)) { | |
8713 | 2244 prefs_info->iter = g_new0(GtkTreeIter, 1); |
2245 prefs_notebook_add_page(_(plug->info->name), NULL, | |
8745 | 2246 gtk_frame, prefs_info->iter, |
9150 | 2247 (plug->info->type == GAIM_PLUGIN_PROTOCOL) ? NULL : &plugin_iter, |
8713 | 2248 notebook_page++); |
8814 | 2249 } else if(prefs_info->frame) { |
2250 /* in the event that there is a pref frame and we can | |
2251 * not make a widget out of it, we free the | |
2252 * pluginpref frame --Gary | |
2253 */ | |
2254 gaim_plugin_pref_frame_destroy(prefs_info->frame); | |
8713 | 2255 } |
2256 } | |
5440 | 2257 } |
2258 } | |
2259 } | |
2260 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2261 void gaim_gtk_prefs_show(void) |
5440 | 2262 { |
10078 | 2263 GtkWidget *vbox; |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2264 GtkWidget *bbox; |
5440 | 2265 GtkWidget *notebook; |
2266 GtkWidget *button; | |
2267 | |
2268 if (prefs) { | |
2269 gtk_window_present(GTK_WINDOW(prefs)); | |
2270 return; | |
2271 } | |
2272 | |
2273 /* copy the preferences to tmp values... | |
2274 * I liked "take affect immediately" Oh well :-( */ | |
6016 | 2275 /* (that should have been "effect," right?) */ |
2276 | |
5440 | 2277 /* Back to instant-apply! I win! BU-HAHAHA! */ |
2278 | |
2279 /* Create the window */ | |
2280 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
2281 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); | |
2282 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); | |
2283 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); | |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2284 gtk_container_set_border_width(GTK_CONTAINER(prefs), 12); |
5440 | 2285 g_signal_connect(G_OBJECT(prefs), "destroy", |
2286 G_CALLBACK(delete_prefs), NULL); | |
2287 | |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2288 vbox = gtk_vbox_new(FALSE, 12); |
5440 | 2289 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
2290 gtk_widget_show(vbox); | |
2291 | |
2292 /* The notebook */ | |
2293 prefsnotebook = notebook = gtk_notebook_new (); | |
10078 | 2294 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_LEFT); |
2295 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), TRUE); | |
5440 | 2296 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); |
10078 | 2297 gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
2298 | |
5440 | 2299 |
8713 | 2300 /* The buttons to press! */ |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2301 bbox = gtk_hbutton_box_new(); |
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2302 gtk_box_set_spacing(GTK_BOX(bbox), 6); |
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2303 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); |
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2304 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); |
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2305 gtk_widget_show (bbox); |
5440 | 2306 |
2307 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); | |
2308 g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
2309 G_CALLBACK(gtk_widget_destroy), prefs); | |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2310 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
5440 | 2311 gtk_widget_show(button); |
2312 | |
2313 prefs_notebook_init(); | |
2314 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2315 /* Show everything. */ |
10078 | 2316 gtk_widget_show_all(prefs); |
5440 | 2317 } |
2318 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2319 static void |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2320 set_bool_pref(GtkWidget *w, const char *key) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2321 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2322 gaim_prefs_set_bool(key, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2323 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2324 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2325 |
7976 | 2326 GtkWidget * |
7987 | 2327 gaim_gtk_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
5440 | 2328 { |
2329 GtkWidget *button; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2330 |
5440 | 2331 button = gtk_check_button_new_with_mnemonic(text); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2332 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2333 gaim_prefs_get_bool(key)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2334 |
5440 | 2335 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
|
2336 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2337 g_signal_connect(G_OBJECT(button), "clicked", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2338 G_CALLBACK(set_bool_pref), (char *)key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2339 |
5440 | 2340 gtk_widget_show(button); |
2341 | |
2342 return button; | |
2343 } | |
2344 | |
2345 void default_away_menu_init(GtkWidget *omenu) | |
2346 { | |
9944 | 2347 GtkWidget *menu; |
2348 /* XXX CORE/UI | |
2349 GtkWidget *opt; | |
6216 | 2350 int index = 0, default_index = 0; |
5440 | 2351 GSList *awy = away_messages; |
2352 struct away_message *a; | |
9944 | 2353 */ |
6216 | 2354 const char *default_name; |
5440 | 2355 |
2356 menu = gtk_menu_new(); | |
2357 | |
6216 | 2358 default_name = gaim_prefs_get_string("/core/away/default_message"); |
2359 | |
9944 | 2360 /* XXX CORE/UI |
5440 | 2361 while (awy) { |
2362 a = (struct away_message *)awy->data; | |
2363 opt = gtk_menu_item_new_with_label(a->name); | |
2364 g_signal_connect(G_OBJECT(opt), "activate", | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2365 G_CALLBACK(set_default_away), GINT_TO_POINTER(index)); |
5440 | 2366 gtk_widget_show(opt); |
2367 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
2368 | |
6216 | 2369 if(!strcmp(default_name, a->name)) |
2370 default_index = index; | |
2371 | |
5440 | 2372 awy = awy->next; |
2373 index++; | |
2374 } | |
9944 | 2375 */ |
5440 | 2376 |
2377 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2378 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
9944 | 2379 |
2380 /* XXX CORE/UI | |
6216 | 2381 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), default_index); |
9944 | 2382 */ |
5440 | 2383 } |
2384 | |
9944 | 2385 /* XXX CORE/UI */ |
2386 #if 0 | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2387 void set_default_away(GtkWidget *w, gpointer data) |
5440 | 2388 { |
6216 | 2389 struct away_message *default_away = NULL; |
5440 | 2390 int length = g_slist_length(away_messages); |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2391 int i = GPOINTER_TO_INT(data); |
5440 | 2392 |
2393 if (away_messages == NULL) | |
2394 default_away = NULL; | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2395 else if (i >= length) |
5440 | 2396 default_away = g_slist_nth_data(away_messages, length - 1); |
2397 else | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2398 default_away = g_slist_nth_data(away_messages, i); |
6216 | 2399 |
2400 if(default_away) | |
2401 gaim_prefs_set_string("/core/away/default_message", default_away->name); | |
2402 else | |
2403 gaim_prefs_set_string("/core/away/default_message", ""); | |
5440 | 2404 } |
9944 | 2405 #endif |
5440 | 2406 |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2407 static void |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2408 smiley_theme_pref_cb(const char *name, GaimPrefType type, gpointer value, |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2409 gpointer data) |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2410 { |
5841 | 2411 if (!strcmp(name, "/gaim/gtk/smileys/theme")) |
5771
f63a008726c6
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2412 load_smiley_theme((const char *)value, TRUE); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2413 } |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2414 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2415 void |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2416 gaim_gtk_prefs_init(void) |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2417 { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2418 gaim_prefs_add_none("/gaim"); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2419 gaim_prefs_add_none("/gaim/gtk"); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2420 gaim_prefs_add_none("/plugins/gtk"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2421 |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2422 /* XXX Move this! HACK! :( Aww... */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2423 gaim_prefs_add_none("/plugins/gtk/docklet"); |
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5551
diff
changeset
|
2424 gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2425 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2426 /* Away Queueing */ |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2427 gaim_prefs_add_none("/gaim/gtk/away"); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2428 gaim_prefs_add_bool("/gaim/gtk/away/queue_messages", FALSE); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2429 |
8283 | 2430 #ifndef _WIN32 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2431 /* Browsers */ |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2432 gaim_prefs_add_none("/gaim/gtk/browsers"); |
8272 | 2433 gaim_prefs_add_int("/gaim/gtk/browsers/place", GAIM_BROWSER_DEFAULT); |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2434 gaim_prefs_add_string("/gaim/gtk/browsers/command", ""); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2435 gaim_prefs_add_string("/gaim/gtk/browsers/browser", "mozilla"); |
8283 | 2436 #endif |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2437 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2438 /* Idle */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2439 gaim_prefs_add_none("/gaim/gtk/idle"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2440 gaim_prefs_add_string("/gaim/gtk/idle/reporting_method", "system"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2441 |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2442 /* Plugins */ |
5982
35d3c1ac5ece
[gaim-migrate @ 6430]
Christian Hammond <chipx86@chipx86.com>
parents:
5981
diff
changeset
|
2443 gaim_prefs_add_none("/gaim/gtk/plugins"); |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2444 gaim_prefs_add_string_list("/gaim/gtk/plugins/loaded", NULL); |
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2445 |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2446 /* Smiley Themes */ |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2447 gaim_prefs_add_none("/gaim/gtk/smileys"); |
9707 | 2448 gaim_prefs_add_string("/gaim/gtk/smileys/theme", "default"); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2449 |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2450 /* Smiley Callbacks */ |
10087 | 2451 gaim_prefs_connect_callback(prefs, "/gaim/gtk/smileys/theme", |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2452 smiley_theme_pref_cb, NULL); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2453 } |
8905 | 2454 |
2455 void gaim_gtk_prefs_update_old() { | |
2456 /* Rename some old prefs */ | |
2457 gaim_prefs_rename("/gaim/gtk/logging/log_ims", "/core/logging/log_ims"); | |
2458 gaim_prefs_rename("/gaim/gtk/logging/log_chats", "/core/logging/log_chats"); | |
2459 gaim_prefs_rename("/core/conversations/placement", | |
8998 | 2460 "/gaim/gtk/conversations/placement"); |
8905 | 2461 |
9025 | 2462 gaim_prefs_rename("/gaim/gtk/conversations/use_custom_font", |
2463 "/gaim/gtk/conversations/send_formatting"); | |
2464 | |
9150 | 2465 gaim_prefs_rename("/gaim/gtk/conversations/im/button_type", |
2466 "/gaim/gtk/conversations/button_type"); | |
2467 | |
8905 | 2468 /* Remove some no-longer-used prefs */ |
10133 | 2469 gaim_prefs_remove("/gaim/gtk/blist/button_style"); |
10168 | 2470 gaim_prefs_remove("/gaim/gtk/blist/grey_idle_buddies"); |
10133 | 2471 gaim_prefs_remove("/gaim/gtk/blist/raise_on_events"); |
8945 | 2472 gaim_prefs_remove("/gaim/gtk/blist/show_group_count"); |
10164 | 2473 gaim_prefs_remove("/gaim/gtk/conversations/html_shortcuts"); |
8946 | 2474 gaim_prefs_remove("/gaim/gtk/conversations/icons_on_tabs"); |
8905 | 2475 gaim_prefs_remove("/gaim/gtk/conversations/show_urls_as_links"); |
2476 gaim_prefs_remove("/gaim/gtk/conversations/show_smileys"); | |
10164 | 2477 gaim_prefs_remove("/gaim/gtk/conversations/smiley_shortcuts"); |
8941 | 2478 gaim_prefs_remove("/gaim/gtk/conversations/chat/tab_completion"); |
2479 gaim_prefs_remove("/gaim/gtk/conversations/chat/old_tab_complete"); | |
8947 | 2480 gaim_prefs_remove("/gaim/gtk/sound/signon"); |
2481 gaim_prefs_remove("/gaim/gtk/sound/silent_signon"); | |
8998 | 2482 gaim_prefs_remove("/gaim/gtk/logging/individual_logs"); |
9025 | 2483 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_bgcolor"); |
2484 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_fgcolor"); | |
2485 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_size"); | |
9301 | 2486 gaim_prefs_remove("/gaim/gtk/conversations/im/hide_on_send"); |
8905 | 2487 } |