Mercurial > pidgin
annotate src/gtkprefs.c @ 10157:0de7eee583e6
[gaim-migrate @ 11237]
Vite McSpacen
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 04 Nov 2004 05:13:08 +0000 |
parents | e144efd6a5be |
children | 34a8bbf5b1b9 |
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")) { | |
611 /* Sort name1 first */ | |
612 ret = -1; | |
613 } else if (!g_ascii_strcasecmp(name2, "none")) { | |
614 /* Sort name2 first */ | |
615 ret = 1; | |
616 } else { | |
617 /* Neither string is "none", default to normal sort */ | |
618 ret = g_utf8_collate(name1,name2); | |
619 } | |
620 | |
9521 | 621 g_free(name1); |
622 g_free(name2); | |
623 | |
8928 | 624 return ret; |
625 } | |
626 | |
5440 | 627 GtkWidget *theme_page() { |
628 GtkWidget *ret; | |
629 GtkWidget *sw; | |
630 GtkWidget *view; | |
631 GtkCellRenderer *rend; | |
632 GtkTreeViewColumn *col; | |
633 GtkTreeSelection *sel; | |
634 GtkTreePath *path = NULL; | |
635 GtkWidget *label; | |
636 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; | |
637 | |
638 ret = gtk_vbox_new(FALSE, 18); | |
639 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
640 | |
641 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.")); | |
642 | |
643 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
644 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | |
645 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
646 | |
647 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
648 gtk_widget_show(label); | |
649 | |
650 sw = gtk_scrolled_window_new(NULL,NULL); | |
7939 | 651 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
7931 | 652 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
5440 | 653 |
654 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
8928 | 655 smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); |
5440 | 656 |
657 path = theme_refresh_theme_list(); | |
8075 | 658 |
5440 | 659 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
660 | |
661 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
662 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
663 | |
664 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
665 | |
666 rend = gtk_cell_renderer_pixbuf_new(); | |
667 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
668 | |
669 if(path) { | |
670 gtk_tree_selection_select_path(sel, path); | |
671 gtk_tree_path_free(path); | |
672 } | |
8928 | 673 |
674 /* Custom sort so "none" theme is at top of list */ | |
675 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_store), | |
676 3, gaim_sort_smileys, NULL, NULL); | |
677 | |
8075 | 678 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store), |
8928 | 679 3, GTK_SORT_ASCENDING); |
5440 | 680 |
681 col = gtk_tree_view_column_new_with_attributes (_("Icon"), | |
682 rend, | |
683 "pixbuf", 0, | |
684 NULL); | |
685 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
686 | |
687 rend = gtk_cell_renderer_text_new(); | |
688 col = gtk_tree_view_column_new_with_attributes (_("Description"), | |
689 rend, | |
690 "markup", 1, | |
691 NULL); | |
692 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
693 g_object_unref(G_OBJECT(smiley_theme_store)); | |
694 gtk_container_add(GTK_CONTAINER(sw), view); | |
695 | |
8075 | 696 g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL); |
5440 | 697 |
698 gtk_widget_show_all(ret); | |
8137 | 699 |
700 gaim_set_accessible_label (view, label); | |
701 | |
5440 | 702 return ret; |
703 } | |
704 | |
9025 | 705 static void |
706 formatting_reset_cb(GtkWidget *w, GtkWidget* imhtml) { | |
707 gboolean bold, italic, uline; | |
708 bold = italic = uline = FALSE; | |
709 | |
710 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), &bold, &italic, &uline); | |
711 if (bold) | |
712 gtk_imhtml_toggle_bold(GTK_IMHTML(imhtml)); | |
713 if (italic) | |
714 gtk_imhtml_toggle_italic(GTK_IMHTML(imhtml)); | |
715 if (uline) | |
716 gtk_imhtml_toggle_underline(GTK_IMHTML(imhtml)); | |
717 | |
718 gtk_imhtml_font_set_size(GTK_IMHTML(imhtml), 3); | |
719 gtk_imhtml_toggle_forecolor(GTK_IMHTML(imhtml), NULL); | |
720 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), NULL); | |
721 gtk_imhtml_toggle_fontface(GTK_IMHTML(imhtml), NULL); | |
722 } | |
723 | |
724 static void | |
725 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *bah) | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
726 { |
9025 | 727 gboolean bold, italic, uline; |
728 | |
729 bold = italic = uline = FALSE; | |
730 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), | |
731 &bold, &italic, &uline); | |
732 | |
733 if (buttons & GTK_IMHTML_BOLD) | |
734 gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold", bold); | |
735 if (buttons & GTK_IMHTML_ITALIC) | |
736 gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic", italic); | |
737 if (buttons & GTK_IMHTML_UNDERLINE) | |
738 gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline", uline); | |
739 | |
740 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK) | |
741 gaim_prefs_set_int("/gaim/gtk/conversations/font_size", | |
742 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); | |
743 if (buttons & GTK_IMHTML_FACE) { | |
744 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); | |
745 if (!face) | |
746 face = g_strdup(""); | |
747 | |
748 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", face); | |
749 g_free(face); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
750 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
751 |
9025 | 752 if (buttons & GTK_IMHTML_FORECOLOR) { |
753 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); | |
754 if (!color) | |
755 color = g_strdup(""); | |
756 | |
757 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", color); | |
758 g_free(color); | |
759 } | |
760 | |
761 if (buttons & GTK_IMHTML_BACKCOLOR) { | |
762 char *color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); | |
763 if (!color) | |
764 color = g_strdup(""); | |
765 | |
766 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", color); | |
767 g_free(color); | |
768 } | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
769 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
770 |
8988 | 771 GtkWidget *messages_page() { |
5440 | 772 GtkWidget *ret; |
9025 | 773 GtkWidget *vbox, *fontvbox; |
8833 | 774 GtkWidget *imhtml; |
775 GtkWidget *toolbar; | |
776 GtkWidget *sw; | |
8988 | 777 GtkWidget *frame; |
9025 | 778 GtkWidget *option; |
779 GtkWidget *button; | |
5440 | 780 |
781 ret = gtk_vbox_new(FALSE, 18); | |
782 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
783 | |
8988 | 784 vbox = gaim_gtk_make_frame (ret, _("Display")); |
785 gaim_gtk_prefs_checkbox(_("Show _timestamp on messages"), | |
786 "/gaim/gtk/conversations/show_timestamps", vbox); | |
787 #ifdef USE_GTKSPELL | |
788 gaim_gtk_prefs_checkbox(_("_Highlight misspelled words"), | |
789 "/gaim/gtk/conversations/spellcheck", vbox); | |
790 #endif | |
9049 | 791 vbox = gaim_gtk_make_frame (ret, _("Ignore")); |
792 gaim_gtk_prefs_checkbox(_("Ignore c_olors"), | |
793 "/gaim/gtk/conversations/ignore_colors", vbox); | |
794 gaim_gtk_prefs_checkbox(_("Ignore font _faces"), | |
795 "/gaim/gtk/conversations/ignore_fonts", vbox); | |
796 gaim_gtk_prefs_checkbox(_("Ignore font si_zes"), | |
797 "/gaim/gtk/conversations/ignore_font_sizes", vbox); | |
8988 | 798 |
799 vbox = gaim_gtk_make_frame (ret, _("Default Formatting")); | |
800 | |
9025 | 801 option = gaim_gtk_prefs_checkbox(_("_Send default formatting with outgoing messages"), |
802 "/gaim/gtk/conversations/send_formatting", vbox); | |
803 | |
8988 | 804 frame = gtk_frame_new(NULL); |
805 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); | |
806 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0); | |
807 | |
9025 | 808 fontvbox = gtk_vbox_new(FALSE, 0); |
809 gtk_container_add(GTK_CONTAINER(frame), fontvbox); | |
8988 | 810 |
8833 | 811 toolbar = gtk_imhtmltoolbar_new(); |
9025 | 812 gtk_box_pack_start(GTK_BOX(fontvbox), toolbar, FALSE, FALSE, 0); |
8833 | 813 |
814 sw = gtk_scrolled_window_new(NULL, NULL); | |
815 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
816 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
8988 | 817 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
9025 | 818 gtk_box_pack_start(GTK_BOX(fontvbox), sw, TRUE, TRUE, 0); |
8833 | 819 |
820 imhtml = gtk_imhtml_new(NULL, NULL); | |
9025 | 821 gtk_widget_set_name(imhtml, "gaim_gtkprefs_font_imhtml"); |
8833 | 822 gtk_imhtml_set_editable(GTK_IMHTML(imhtml), TRUE); |
823 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), GTK_IMHTML_ALL ^ GTK_IMHTML_IMAGE); | |
8836 | 824 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); |
8833 | 825 |
826 gtk_imhtml_smiley_shortcuts(GTK_IMHTML(imhtml), | |
827 gaim_prefs_get_bool("/gaim/gtk/conversations/smiley_shortcuts")); | |
828 gtk_imhtml_html_shortcuts(GTK_IMHTML(imhtml), | |
829 gaim_prefs_get_bool("/gaim/gtk/conversations/html_shortcuts")); | |
830 gtk_imhtmltoolbar_attach(GTK_IMHTMLTOOLBAR(toolbar), imhtml); | |
831 gtk_imhtmltoolbar_associate_smileys(GTK_IMHTMLTOOLBAR(toolbar), "default"); | |
832 gaim_setup_imhtml(imhtml); | |
9025 | 833 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 | 834 gtk_container_add(GTK_CONTAINER(sw), imhtml); |
8988 | 835 |
9056 | 836 button = gtk_button_new_with_mnemonic(_("_Clear Formatting")); |
9025 | 837 gtk_box_pack_start(GTK_BOX(fontvbox), button, FALSE, FALSE, 0); |
838 | |
839 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/send_formatting")) | |
840 gtk_widget_set_sensitive(fontvbox, FALSE); | |
841 | |
8836 | 842 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_bold")) |
843 gtk_imhtml_toggle_bold(GTK_IMHTML(imhtml)); | |
844 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_italic")) | |
845 gtk_imhtml_toggle_italic(GTK_IMHTML(imhtml)); | |
846 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_underline")) | |
847 gtk_imhtml_toggle_underline(GTK_IMHTML(imhtml)); | |
848 | |
849 gtk_imhtml_font_set_size(GTK_IMHTML(imhtml), gaim_prefs_get_int("/gaim/gtk/conversations/font_size")); | |
850 gtk_imhtml_toggle_forecolor(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor")); | |
851 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor")); | |
852 gtk_imhtml_toggle_fontface(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/font_face")); | |
853 | |
9025 | 854 g_signal_connect(G_OBJECT(button), "clicked", |
855 G_CALLBACK(formatting_reset_cb), imhtml); | |
856 | |
857 g_signal_connect(G_OBJECT(option), "clicked", | |
858 G_CALLBACK(gaim_gtk_toggle_sensitive), fontvbox); | |
859 | |
860 g_signal_connect(G_OBJECT(imhtml), "format_function_toggle", | |
861 G_CALLBACK(formatting_toggle_cb), NULL); | |
862 | |
5440 | 863 gtk_widget_show_all(ret); |
864 return ret; | |
865 } | |
866 | |
867 GtkWidget *hotkeys_page() { | |
868 GtkWidget *ret; | |
869 GtkWidget *vbox; | |
870 ret = gtk_vbox_new(FALSE, 18); | |
871 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
872 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
873 vbox = gaim_gtk_make_frame (ret, _("Window Closing")); |
7987 | 874 gaim_gtk_prefs_checkbox(_("_Escape closes window"), |
875 "/gaim/gtk/conversations/escape_closes", vbox); | |
5440 | 876 |
877 gtk_widget_show_all(ret); | |
878 return ret; | |
879 } | |
880 | |
881 GtkWidget *list_page() { | |
882 GtkWidget *ret; | |
883 GtkWidget *vbox; | |
884 GList *l= NULL; | |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
885 GSList *sl; |
5440 | 886 ret = gtk_vbox_new(FALSE, 18); |
887 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
7305 | 888 |
889 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
890 vbox = gaim_gtk_make_frame (ret, _("Buddy List Sorting")); |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
891 |
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
892 for (sl = gaim_gtk_blist_sort_methods; sl != NULL; sl = sl->next) { |
5631 | 893 struct gaim_gtk_blist_sort_method *method = sl->data; |
894 | |
895 l = g_list_append(l, method->name); | |
896 l = g_list_append(l, method->id); | |
5440 | 897 } |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
898 |
8063 | 899 gaim_gtk_prefs_dropdown_from_list(vbox, _("_Sorting:"), GAIM_PREF_STRING, |
7987 | 900 "/gaim/gtk/blist/sort_type", l); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
901 |
5440 | 902 g_list_free(l); |
903 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
904 vbox = gaim_gtk_make_frame (ret, _("Buddy Display")); |
7987 | 905 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), |
7305 | 906 "/gaim/gtk/blist/show_buddy_icons", vbox); |
7987 | 907 gaim_gtk_prefs_checkbox(_("Show _warning levels"), |
7305 | 908 "/gaim/gtk/blist/show_warning_level", vbox); |
7987 | 909 gaim_gtk_prefs_checkbox(_("Show idle _times"), |
7305 | 910 "/gaim/gtk/blist/show_idle_time", vbox); |
7987 | 911 gaim_gtk_prefs_checkbox(_("_Automatically expand contacts"), |
7731 | 912 "/gaim/gtk/blist/auto_expand_contacts", vbox); |
5440 | 913 |
914 gtk_widget_show_all(ret); | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
915 |
5440 | 916 return ret; |
917 } | |
918 | |
8979 | 919 static void |
9155 | 920 conversation_usetabs_cb(const char *name, GaimPrefType type, gpointer value, |
8979 | 921 gpointer data) |
922 { | |
10112 | 923 gboolean usetabs = GPOINTER_TO_INT(value); |
9155 | 924 |
925 if (usetabs) | |
926 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); | |
927 else | |
8979 | 928 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
929 } | |
930 | |
5440 | 931 GtkWidget *conv_page() { |
932 GtkWidget *ret; | |
9155 | 933 GtkWidget *vbox, *vbox2; |
5440 | 934 GtkWidget *label; |
935 GtkSizeGroup *sg; | |
936 GList *names = NULL; | |
937 | |
938 ret = gtk_vbox_new(FALSE, 18); | |
939 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
940 | |
941 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
942 vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
5440 | 943 |
9150 | 944 label = gaim_gtk_prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
945 "/gaim/gtk/conversations/button_type", | |
946 _("Pictures"), GAIM_BUTTON_IMAGE, | |
947 _("Text"), GAIM_BUTTON_TEXT, | |
948 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, | |
949 _("None"), GAIM_BUTTON_NONE, | |
950 NULL); | |
951 gtk_size_group_add_widget(sg, label); | |
952 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
953 | |
9832 | 954 #if 0 |
9301 | 955 gaim_gtk_prefs_checkbox(_("Enable \"_slash\" commands"), |
956 "/gaim/gtk/conversations/enable_commands", vbox); | |
9832 | 957 #endif |
958 gaim_gtk_prefs_checkbox(_("Send unknown \"_slash\" commands as messages"), | |
959 "/gaim/gtk/conversations/passthrough_unknown_commands", vbox); | |
9301 | 960 |
8600 | 961 gaim_gtk_prefs_checkbox(_("Show _formatting toolbar"), |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7305
diff
changeset
|
962 "/gaim/gtk/conversations/show_formatting_toolbar", vbox); |
9155 | 963 gaim_gtk_prefs_checkbox(_("Show _aliases in tabs/titles"), |
8015 | 964 "/core/conversations/use_alias_for_title", vbox); |
9150 | 965 gaim_gtk_prefs_checkbox(_("Show buddy _icons"), |
966 "/gaim/gtk/conversations/im/show_buddy_icons", vbox); | |
9155 | 967 gaim_gtk_prefs_checkbox(_("Enable buddy ic_on animation"), |
9150 | 968 "/gaim/gtk/conversations/im/animate_buddy_icons", vbox); |
9155 | 969 gaim_gtk_prefs_checkbox(_("_Notify buddies that you are typing to them"), |
9150 | 970 "/core/conversations/im/send_typing", vbox); |
9301 | 971 gaim_gtk_prefs_checkbox(_("_Raise IM window on events"), |
972 "/gaim/gtk/conversations/im/raise_on_events", vbox); | |
973 | |
9303 | 974 gaim_gtk_prefs_checkbox(_("Raise chat _window on events"), |
9301 | 975 "/gaim/gtk/conversations/chat/raise_on_events", vbox); |
9155 | 976 |
977 /* All the tab options! */ | |
978 vbox = gaim_gtk_make_frame(ret, _("Tab Options")); | |
979 | |
980 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
|
981 "/gaim/gtk/conversations/tabs", vbox); |
9155 | 982 |
983 /* | |
984 * Connect a signal to the above preference. When conversations are not | |
985 * shown in a tabbed window then all tabbing options should be disabled. | |
986 */ | |
987 vbox2 = gtk_vbox_new(FALSE, 0); | |
988 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); | |
10087 | 989 gaim_prefs_connect_callback(prefs, "/gaim/gtk/conversations/tabs", |
990 conversation_usetabs_cb, vbox2); | |
9155 | 991 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) |
992 gtk_widget_set_sensitive(vbox2, FALSE); | |
993 | |
9891 | 994 gaim_gtk_prefs_checkbox(_("Show close b_utton on tabs"), |
9155 | 995 "/gaim/gtk/conversations/close_on_tabs", vbox2); |
996 | |
997 label = gaim_gtk_prefs_dropdown(vbox2, _("Tab p_lacement:"), GAIM_PREF_INT, | |
8988 | 998 "/gaim/gtk/conversations/tab_side", |
999 _("Top"), GTK_POS_TOP, | |
1000 _("Bottom"), GTK_POS_BOTTOM, | |
1001 _("Left"), GTK_POS_LEFT, | |
1002 _("Right"), GTK_POS_RIGHT, | |
1003 NULL); | |
1004 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1005 gtk_size_group_add_widget(sg, label); | |
1006 | |
9155 | 1007 names = gaim_conv_placement_get_options(); |
9251 | 1008 label = gaim_gtk_prefs_dropdown_from_list(vbox2, _("New conversation _placement:"), |
9155 | 1009 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); |
1010 gtk_size_group_add_widget(sg, label); | |
1011 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1012 g_list_free(names); | |
1013 | |
5440 | 1014 gtk_widget_show_all(ret); |
1015 | |
1016 return ret; | |
1017 } | |
1018 | |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1019 static void network_ip_changed(GtkEntry *entry, gpointer data) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1020 { |
8834 | 1021 gaim_network_set_public_ip(gtk_entry_get_text(entry)); |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1022 } |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1023 |
9150 | 1024 static void |
1025 proxy_changed_cb(const char *name, GaimPrefType type, gpointer value, | |
1026 gpointer data) | |
1027 { | |
1028 GtkWidget *frame = data; | |
1029 const char *proxy = value; | |
1030 | |
1031 if (strcmp(proxy, "none") && strcmp(proxy, "envvar")) | |
1032 gtk_widget_set_sensitive(frame, TRUE); | |
1033 else | |
1034 gtk_widget_set_sensitive(frame, FALSE); | |
1035 } | |
1036 | |
1037 static void proxy_print_option(GtkEntry *entry, int entrynum) | |
1038 { | |
1039 if (entrynum == PROXYHOST) | |
1040 gaim_prefs_set_string("/core/proxy/host", gtk_entry_get_text(entry)); | |
1041 else if (entrynum == PROXYPORT) | |
1042 gaim_prefs_set_int("/core/proxy/port", atoi(gtk_entry_get_text(entry))); | |
1043 else if (entrynum == PROXYUSER) | |
1044 gaim_prefs_set_string("/core/proxy/username", gtk_entry_get_text(entry)); | |
1045 else if (entrynum == PROXYPASS) | |
1046 gaim_prefs_set_string("/core/proxy/password", gtk_entry_get_text(entry)); | |
1047 } | |
1048 | |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1049 GtkWidget *network_page() { |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1050 GtkWidget *ret; |
9150 | 1051 GtkWidget *vbox, *hbox, *entry; |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1052 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button; |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1053 GtkSizeGroup *sg; |
9150 | 1054 GaimProxyInfo *proxy_info; |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1055 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1056 ret = gtk_vbox_new(FALSE, 18); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1057 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1058 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1059 vbox = gaim_gtk_make_frame (ret, _("IP Address")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1060 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1061 auto_ip_checkbox = gaim_gtk_prefs_checkbox(_("_Autodetect IP Address"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1062 "/core/network/auto_ip", vbox); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1063 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1064 table = gtk_table_new(2, 1, FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1065 gtk_container_set_border_width(GTK_CONTAINER(table), 5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1066 gtk_table_set_col_spacings(GTK_TABLE(table), 5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1067 gtk_table_set_row_spacings(GTK_TABLE(table), 10); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1068 gtk_container_add(GTK_CONTAINER(vbox), table); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1069 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1070 label = gtk_label_new_with_mnemonic(_("Public _IP:")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1071 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1072 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
|
1073 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1074 entry = gtk_entry_new(); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1075 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1076 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
|
1077 g_signal_connect(G_OBJECT(entry), "changed", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1078 G_CALLBACK(network_ip_changed), NULL); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1079 |
8834 | 1080 if (gaim_network_get_public_ip() != NULL) |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1081 gtk_entry_set_text(GTK_ENTRY(entry), |
8834 | 1082 gaim_network_get_public_ip()); |
8231
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1083 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1084 gaim_set_accessible_label (entry, label); |
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 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1087 if (gaim_prefs_get_bool("/core/network/auto_ip")) { |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1088 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE); |
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 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1091 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1092 G_CALLBACK(gaim_gtk_toggle_sensitive), table); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1093 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1094 vbox = gaim_gtk_make_frame (ret, _("Ports")); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1095 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1096 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1097 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
|
1098 "/core/network/ports_range_use", vbox); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1099 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1100 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_Start Port:"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1101 "/core/network/ports_range_start", 0, 65535, sg); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1102 if (!gaim_prefs_get_bool("/core/network/ports_range_use")) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1103 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1104 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1105 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1106 |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1107 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_End Port:"), |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1108 "/core/network/ports_range_end", 0, 65535, sg); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1109 if (!gaim_prefs_get_bool("/core/network/ports_range_use")) |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1110 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1111 g_signal_connect(G_OBJECT(ports_checkbox), "clicked", |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1112 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button); |
f50c059b6384
[gaim-migrate @ 8954]
Christian Hammond <chipx86@chipx86.com>
parents:
8188
diff
changeset
|
1113 |
9150 | 1114 vbox = gaim_gtk_make_frame(ret, _("Proxy Server")); |
1115 prefs_proxy_frame = gtk_vbox_new(FALSE, 0); | |
7987 | 1116 gaim_gtk_prefs_dropdown(vbox, _("Proxy _type:"), GAIM_PREF_STRING, |
9150 | 1117 "/core/proxy/type", |
1118 _("No proxy"), "none", | |
1119 "SOCKS 4", "socks4", | |
1120 "SOCKS 5", "socks5", | |
1121 "HTTP", "http", | |
1122 _("Use Environmental Settings"), "envvar", | |
1123 NULL); | |
1124 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
|
1125 proxy_info = gaim_global_proxy_get_info(); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1126 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1127 if (proxy_info == NULL || |
6621 | 1128 gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_NONE || |
1129 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
|
1130 |
6001 | 1131 gtk_widget_set_sensitive(GTK_WIDGET(prefs_proxy_frame), FALSE); |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1132 } |
10087 | 1133 gaim_prefs_connect_callback(prefs, "/core/proxy/type", |
1134 proxy_changed_cb, prefs_proxy_frame); | |
9150 | 1135 |
1136 table = gtk_table_new(4, 2, FALSE); | |
5440 | 1137 gtk_container_set_border_width(GTK_CONTAINER(table), 5); |
1138 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
1139 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
9150 | 1140 gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table); |
5440 | 1141 |
1142 | |
7797 | 1143 label = gtk_label_new_with_mnemonic(_("_Host:")); |
5440 | 1144 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
1145 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1146 | |
1147 entry = gtk_entry_new(); | |
1148 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1149 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
1150 g_signal_connect(G_OBJECT(entry), "changed", | |
1151 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1152 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1153 if (proxy_info != NULL && gaim_proxy_info_get_host(proxy_info)) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1154 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1155 gaim_proxy_info_get_host(proxy_info)); |
5440 | 1156 |
1157 hbox = gtk_hbox_new(TRUE, 5); | |
1158 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
8137 | 1159 gaim_set_accessible_label (entry, label); |
5440 | 1160 |
7870 | 1161 label = gtk_label_new_with_mnemonic(_("_Port:")); |
5440 | 1162 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
9150 | 1163 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0); |
5440 | 1164 |
1165 entry = gtk_entry_new(); | |
1166 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
9150 | 1167 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0); |
5440 | 1168 g_signal_connect(G_OBJECT(entry), "changed", |
1169 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
1170 | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1171 if (proxy_info != NULL && gaim_proxy_info_get_port(proxy_info) != 0) { |
5440 | 1172 char buf[128]; |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1173 g_snprintf(buf, sizeof(buf), "%d", |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1174 gaim_proxy_info_get_port(proxy_info)); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1175 |
5440 | 1176 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
1177 } | |
8137 | 1178 gaim_set_accessible_label (entry, label); |
5440 | 1179 |
7797 | 1180 label = gtk_label_new_with_mnemonic(_("_User:")); |
5440 | 1181 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
9150 | 1182 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); |
5440 | 1183 |
1184 entry = gtk_entry_new(); | |
1185 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
9150 | 1186 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
5440 | 1187 g_signal_connect(G_OBJECT(entry), "changed", |
1188 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1189 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1190 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
|
1191 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1192 gaim_proxy_info_get_username(proxy_info)); |
5440 | 1193 |
1194 hbox = gtk_hbox_new(TRUE, 5); | |
1195 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
8137 | 1196 gaim_set_accessible_label (entry, label); |
5440 | 1197 |
7797 | 1198 label = gtk_label_new_with_mnemonic(_("Pa_ssword:")); |
5440 | 1199 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
9150 | 1200 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0); |
5440 | 1201 |
1202 entry = gtk_entry_new(); | |
1203 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
9150 | 1204 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0); |
5440 | 1205 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
1206 g_signal_connect(G_OBJECT(entry), "changed", | |
1207 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1208 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1209 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
|
1210 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1211 gaim_proxy_info_get_password(proxy_info)); |
8137 | 1212 gaim_set_accessible_label (entry, label); |
5440 | 1213 |
1214 gtk_widget_show_all(ret); | |
1215 return ret; | |
1216 } | |
1217 | |
1218 #ifndef _WIN32 | |
1219 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { | |
1220 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1221 | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1222 gaim_prefs_set_string("/gaim/gtk/browsers/command", program); |
5440 | 1223 |
1224 /* carry on normally */ | |
1225 return FALSE; | |
1226 } | |
1227 | |
5633 | 1228 static GList *get_available_browsers() |
5440 | 1229 { |
1230 struct browser { | |
1231 char *name; | |
1232 char *command; | |
1233 }; | |
1234 | |
1235 static struct browser possible_browsers[] = { | |
9405 | 1236 {N_("Epiphany"), "epiphany"}, |
8267 | 1237 {N_("Firebird"), "mozilla-firebird"}, |
8356 | 1238 {N_("Firefox"), "firefox"}, |
9405 | 1239 {N_("Galeon"), "galeon"}, |
1240 {N_("Gnome Default"), "gnome-open"}, | |
1241 {N_("Konqueror"), "kfmclient"}, | |
1242 {N_("Mozilla"), "mozilla"}, | |
1243 {N_("Netscape"), "netscape"}, | |
1244 {N_("Opera"), "opera"} | |
5440 | 1245 }; |
9405 | 1246 static const int num_possible_browsers = 9; |
5440 | 1247 |
1248 GList *browsers = NULL; | |
1249 int i = 0; | |
5819 | 1250 char *browser_setting = (char *)gaim_prefs_get_string("/gaim/gtk/browsers/browser"); |
5440 | 1251 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1252 browsers = g_list_prepend(browsers, "custom"); |
5440 | 1253 browsers = g_list_prepend(browsers, _("Manual")); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1254 |
5440 | 1255 for (i = 0; i < num_possible_browsers; i++) { |
7108
6faeeecab0dc
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1256 if (gaim_program_is_valid(possible_browsers[i].command)) { |
5633 | 1257 browsers = g_list_prepend(browsers, |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1258 possible_browsers[i].command); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1259 browsers = g_list_prepend(browsers, _(possible_browsers[i].name)); |
5825 | 1260 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
5819 | 1261 browser_setting = NULL; |
5440 | 1262 } |
1263 } | |
1264 | |
5819 | 1265 if(browser_setting) |
1266 gaim_prefs_set_string("/gaim/gtk/browsers/browser", "custom"); | |
1267 | |
5440 | 1268 return browsers; |
1269 } | |
1270 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1271 static void |
8274 | 1272 browser_changed1_cb(const char *name, GaimPrefType type, gpointer value, |
1273 gpointer data) | |
1274 { | |
1275 GtkWidget *hbox = data; | |
1276 const char *browser = value; | |
1277 | |
1278 gtk_widget_set_sensitive(hbox, strcmp(browser, "custom")); | |
1279 } | |
1280 | |
1281 static void | |
1282 browser_changed2_cb(const char *name, GaimPrefType type, gpointer value, | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1283 gpointer data) |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1284 { |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1285 GtkWidget *hbox = data; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1286 const char *browser = value; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1287 |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1288 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1289 } |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1290 |
5440 | 1291 GtkWidget *browser_page() { |
1292 GtkWidget *ret; | |
1293 GtkWidget *vbox; | |
1294 GtkWidget *hbox; | |
1295 GtkWidget *label; | |
6007 | 1296 GtkWidget *entry; |
5440 | 1297 GtkSizeGroup *sg; |
1298 GList *browsers = NULL; | |
1299 | |
1300 ret = gtk_vbox_new(FALSE, 18); | |
1301 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1302 | |
1303 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1304 vbox = gaim_gtk_make_frame (ret, _("Browser Selection")); |
5440 | 1305 |
1306 browsers = get_available_browsers(); | |
1307 if (browsers != NULL) { | |
7987 | 1308 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
|
1309 "/gaim/gtk/browsers/browser", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1310 browsers); |
5440 | 1311 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
1312 gtk_size_group_add_widget(sg, label); | |
8274 | 1313 |
1314 hbox = gtk_hbox_new(FALSE, 0); | |
1315 label = gaim_gtk_prefs_dropdown(hbox, _("_Open link in:"), GAIM_PREF_INT, | |
1316 "/gaim/gtk/browsers/place", | |
1317 _("Browser default"), GAIM_BROWSER_DEFAULT, | |
1318 _("Existing window"), GAIM_BROWSER_CURRENT, | |
1319 _("New window"), GAIM_BROWSER_NEW_WINDOW, | |
1320 _("New tab"), GAIM_BROWSER_NEW_TAB, | |
1321 NULL); | |
1322 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1323 gtk_size_group_add_widget(sg, label); | |
1324 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1325 | |
1326 if (!strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) | |
1327 gtk_widget_set_sensitive(hbox, FALSE); | |
10087 | 1328 gaim_prefs_connect_callback(prefs, "/gaim/gtk/browsers/browser", |
1329 browser_changed1_cb, hbox); | |
5440 | 1330 } |
1331 | |
1332 hbox = gtk_hbox_new(FALSE, 5); | |
1333 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
6031 | 1334 label = gtk_label_new_with_mnemonic(_("_Manual:\n(%s for URL)")); |
5440 | 1335 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
1336 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1337 gtk_size_group_add_widget(sg, label); | |
1338 | |
6007 | 1339 entry = gtk_entry_new(); |
1340 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1341 |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1342 if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) |
5440 | 1343 gtk_widget_set_sensitive(hbox, FALSE); |
10087 | 1344 gaim_prefs_connect_callback(prefs, "/gaim/gtk/browsers/browser", |
1345 browser_changed2_cb, hbox); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1346 |
6007 | 1347 gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); |
1348 | |
1349 gtk_entry_set_text(GTK_ENTRY(entry), | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1350 gaim_prefs_get_string("/gaim/gtk/browsers/command")); |
6007 | 1351 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1352 G_CALLBACK(manual_browser_set), NULL); |
8188
cd9ea20cd8ed
[gaim-migrate @ 8909]
Christian Hammond <chipx86@chipx86.com>
parents:
8170
diff
changeset
|
1353 gaim_set_accessible_label (entry, label); |
5440 | 1354 |
1355 gtk_widget_show_all(ret); | |
1356 return ret; | |
1357 } | |
1358 #endif /*_WIN32*/ | |
1359 | |
1360 GtkWidget *logging_page() { | |
1361 GtkWidget *ret; | |
1362 GtkWidget *vbox; | |
7431 | 1363 GList *names; |
8573 | 1364 GtkWidget *sys_box; |
1365 GtkWidget *box; | |
1366 int syslog_enabled = gaim_prefs_get_bool("/core/logging/log_system"); | |
1367 | |
5440 | 1368 ret = gtk_vbox_new(FALSE, 18); |
1369 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1370 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1371 vbox = gaim_gtk_make_frame (ret, _("Message Logs")); |
7431 | 1372 names = gaim_log_logger_get_options(); |
1373 | |
7987 | 1374 gaim_gtk_prefs_dropdown_from_list(vbox, _("Log _Format:"), GAIM_PREF_STRING, |
1375 "/core/logging/format", names); | |
1376 | |
1377 gaim_gtk_prefs_checkbox(_("_Log all instant messages"), | |
7562
b859cfb5f31a
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1378 "/core/logging/log_ims", vbox); |
7987 | 1379 gaim_gtk_prefs_checkbox(_("Log all c_hats"), |
7562
b859cfb5f31a
[gaim-migrate @ 8176]
Christian Hammond <chipx86@chipx86.com>
parents:
7561
diff
changeset
|
1380 "/core/logging/log_chats", vbox); |
8573 | 1381 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1382 vbox = gaim_gtk_make_frame (ret, _("System Logs")); |
8573 | 1383 |
1384 sys_box = gaim_gtk_prefs_checkbox(_("_Enable system log"), | |
1385 "/core/logging/log_system", vbox); | |
1386 | |
1387 box = gaim_gtk_prefs_checkbox(_("Log when buddies _sign on/sign off"), | |
1388 "/core/logging/log_signon_signoff", vbox); | |
1389 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1390 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1391 gtk_widget_set_sensitive(box, syslog_enabled); | |
1392 | |
1393 box = gaim_gtk_prefs_checkbox(_("Log when buddies become _idle/un-idle"), | |
1394 "/core/logging/log_idle_state", vbox); | |
1395 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1396 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1397 gtk_widget_set_sensitive(box, syslog_enabled); | |
1398 | |
1399 box = gaim_gtk_prefs_checkbox(_("Log when buddies go away/come _back"), | |
1400 "/core/logging/log_away_state", vbox); | |
1401 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1402 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1403 gtk_widget_set_sensitive(box, syslog_enabled); | |
1404 | |
1405 box = gaim_gtk_prefs_checkbox(_("Log your _own signons/idleness/awayness"), | |
1406 "/core/logging/log_own_states", vbox); | |
1407 g_signal_connect(G_OBJECT(sys_box), "clicked", | |
1408 G_CALLBACK(gaim_gtk_toggle_sensitive), box); | |
1409 gtk_widget_set_sensitive(box, syslog_enabled); | |
1410 | |
5440 | 1411 gtk_widget_show_all(ret); |
1412 return ret; | |
1413 } | |
1414 | |
1415 #ifndef _WIN32 | |
1416 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
1417 { | |
5684 | 1418 gaim_prefs_set_string("/gaim/gtk/sound/command", |
6007 | 1419 gtk_entry_get_text(GTK_ENTRY(entry))); |
5440 | 1420 return TRUE; |
1421 } | |
6005 | 1422 |
1423 static void | |
10074 | 1424 sound_changed1_cb(const char *name, GaimPrefType type, gpointer value, |
6005 | 1425 gpointer data) |
1426 { | |
1427 GtkWidget *hbox = data; | |
1428 const char *method = value; | |
1429 | |
1430 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); | |
1431 } | |
10074 | 1432 |
1433 static void | |
1434 sound_changed2_cb(const char *name, GaimPrefType type, gpointer value, | |
1435 gpointer data) | |
1436 { | |
1437 GtkWidget *vbox = data; | |
1438 const char *method = value; | |
1439 | |
1440 gtk_widget_set_sensitive(vbox, strcmp(method, "none")); | |
1441 } | |
5440 | 1442 #endif |
1443 | |
9150 | 1444 |
1445 static void | |
1446 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1447 { | |
1448 GtkTreeModel *model = (GtkTreeModel *)data; | |
1449 GtkTreeIter iter; | |
1450 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1451 const char *pref; | |
1452 | |
1453 gtk_tree_model_get_iter (model, &iter, path); | |
1454 gtk_tree_model_get (model, &iter, | |
1455 2, &pref, | |
1456 -1); | |
1457 | |
1458 gaim_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell)); | |
1459 | |
1460 gtk_list_store_set(GTK_LIST_STORE (model), &iter, | |
1461 0, !gtk_cell_renderer_toggle_get_active(cell), | |
1462 -1); | |
1463 | |
1464 gtk_tree_path_free(path); | |
1465 } | |
1466 | |
1467 static void | |
1468 test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1469 { | |
1470 char *pref; | |
1471 gboolean temp_value1, temp_value2; | |
1472 | |
1473 pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", | |
1474 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
1475 | |
1476 temp_value1 = gaim_prefs_get_bool("/core/sound/while_away"); | |
1477 temp_value2 = gaim_prefs_get_bool(pref); | |
1478 | |
1479 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", TRUE); | |
1480 if (!temp_value2) gaim_prefs_set_bool(pref, TRUE); | |
1481 | |
1482 gaim_sound_play_event(sound_row_sel); | |
1483 | |
1484 if (!temp_value1) gaim_prefs_set_bool("/core/sound/while_away", FALSE); | |
1485 if (!temp_value2) gaim_prefs_set_bool(pref, FALSE); | |
1486 | |
1487 g_free(pref); | |
1488 } | |
1489 | |
9508 | 1490 /* |
1491 * Resets a sound file back to default. | |
1492 */ | |
9150 | 1493 static void |
1494 reset_sound(GtkWidget *button, gpointer i_am_also_NULL) | |
1495 { | |
9508 | 1496 gchar *pref; |
1497 | |
1498 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1499 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
9150 | 1500 gaim_prefs_set_string(pref, ""); |
1501 g_free(pref); | |
1502 | |
1503 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); | |
1504 } | |
1505 | |
9508 | 1506 static void |
1507 sound_chosen_cb(void *user_data, const char *filename) | |
9150 | 1508 { |
9508 | 1509 gchar *pref; |
1510 int sound; | |
1511 | |
1512 sound = GPOINTER_TO_INT(user_data); | |
9150 | 1513 |
1514 /* Set it -- and forget it */ | |
1515 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
9508 | 1516 gaim_gtk_sound_get_event_option(sound)); |
1517 gaim_prefs_set_string(pref, filename); | |
9150 | 1518 g_free(pref); |
1519 | |
9508 | 1520 /* |
1521 * If the sound we just changed is still the currently selected | |
1522 * sound, then update the box showing the file name. | |
1523 */ | |
1524 if (sound == sound_row_sel) | |
1525 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); | |
9150 | 1526 } |
1527 | |
9508 | 1528 static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
9150 | 1529 { |
9508 | 1530 gchar *pref; |
1531 const char *filename; | |
1532 | |
1533 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1534 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
1535 filename = gaim_prefs_get_string(pref); | |
1536 g_free(pref); | |
1537 | |
1538 if (*filename == '\0') | |
1539 filename = NULL; | |
1540 | |
1541 gaim_request_file(prefs, _("Sound Selection"), filename, FALSE, | |
1542 G_CALLBACK(sound_chosen_cb), NULL, GINT_TO_POINTER(sound_row_sel)); | |
9150 | 1543 } |
1544 | |
9508 | 1545 static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) { |
9150 | 1546 GtkTreeIter iter; |
1547 GValue val = { 0, }; | |
1548 const char *file; | |
1549 char *pref; | |
1550 | |
1551 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1552 return; | |
1553 gtk_tree_model_get_value (model, &iter, 3, &val); | |
1554 sound_row_sel = g_value_get_uint(&val); | |
1555 | |
1556 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1557 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
1558 file = gaim_prefs_get_string(pref); | |
1559 g_free(pref); | |
1560 if (sound_entry) | |
1561 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); | |
1562 g_value_unset (&val); | |
1563 } | |
1564 | |
5440 | 1565 GtkWidget *sound_page() { |
1566 GtkWidget *ret; | |
9150 | 1567 GtkWidget *vbox, *sw, *button; |
5440 | 1568 GtkSizeGroup *sg; |
9150 | 1569 GtkTreeIter iter; |
1570 GtkWidget *event_view; | |
1571 GtkListStore *event_store; | |
1572 GtkCellRenderer *rend; | |
1573 GtkTreeViewColumn *col; | |
1574 GtkTreeSelection *sel; | |
1575 GtkTreePath *path; | |
1576 GtkWidget *hbox; | |
1577 int j; | |
1578 const char *file; | |
1579 char *pref; | |
5440 | 1580 #ifndef _WIN32 |
1581 GtkWidget *dd; | |
1582 GtkWidget *label; | |
6007 | 1583 GtkWidget *entry; |
5684 | 1584 const char *cmd; |
5440 | 1585 #endif |
1586 | |
1587 ret = gtk_vbox_new(FALSE, 18); | |
1588 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1589 | |
1590 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1591 | |
1592 #ifndef _WIN32 | |
6033 | 1593 vbox = gaim_gtk_make_frame (ret, _("Sound Method")); |
7987 | 1594 dd = gaim_gtk_prefs_dropdown(vbox, _("_Method:"), GAIM_PREF_STRING, |
1595 "/gaim/gtk/sound/method", | |
1596 _("Console beep"), "beep", | |
5440 | 1597 #ifdef USE_AO |
7987 | 1598 _("Automatic"), "automatic", |
1599 "ESD", "esd", | |
1600 "Arts", "arts", | |
5440 | 1601 #endif |
1602 #ifdef USE_NAS_AUDIO | |
7987 | 1603 "NAS", "nas", |
5440 | 1604 #endif |
7987 | 1605 _("Command"), "custom", |
10074 | 1606 _("No sounds"), "none", |
7987 | 1607 NULL); |
5440 | 1608 gtk_size_group_add_widget(sg, dd); |
1609 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1610 | |
1611 hbox = gtk_hbox_new(FALSE, 5); | |
1612 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1613 | |
6031 | 1614 label = gtk_label_new_with_mnemonic(_("Sound c_ommand:\n(%s for filename)")); |
5440 | 1615 gtk_size_group_add_widget(sg, label); |
1616 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1617 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1618 | |
6007 | 1619 entry = gtk_entry_new(); |
1620 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1621 | |
1622 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); | |
5684 | 1623 cmd = gaim_prefs_get_string("/gaim/gtk/sound/command"); |
5440 | 1624 if(cmd) |
6007 | 1625 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
1626 gtk_widget_set_size_request(entry, 75, -1); | |
1627 | |
1628 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5); | |
1629 g_signal_connect(G_OBJECT(entry), "changed", | |
5440 | 1630 G_CALLBACK(sound_cmd_yeah), NULL); |
6005 | 1631 |
1632 gtk_widget_set_sensitive(hbox, | |
1633 !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), | |
1634 "custom")); | |
10087 | 1635 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method", |
1636 sound_changed1_cb, hbox); | |
6005 | 1637 |
8141 | 1638 gaim_set_accessible_label (entry, label); |
5440 | 1639 #endif /* _WIN32 */ |
9150 | 1640 |
10074 | 1641 vbox = gaim_gtk_make_frame (ret, _("Sound Options")); |
1642 gaim_gtk_prefs_checkbox(_("Sounds when conversation has _focus"), | |
1643 "/gaim/gtk/sound/conv_focus", vbox); | |
1644 gaim_gtk_prefs_checkbox(_("_Sounds while away"), | |
1645 "/core/sound/while_away", vbox); | |
1646 | |
10075 | 1647 #ifndef _WIN32 |
10074 | 1648 gtk_widget_set_sensitive(vbox, |
1649 strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), "none")); | |
10087 | 1650 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method", |
1651 sound_changed2_cb, vbox); | |
10075 | 1652 #endif |
10074 | 1653 |
9150 | 1654 vbox = gaim_gtk_make_frame(ret, _("Sound Events")); |
1655 | |
1656 /* The following is an ugly hack to make the frame expand so the | |
1657 * sound events list is big enough to be usable */ | |
1658 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, | |
1659 GTK_PACK_START); | |
1660 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, | |
1661 TRUE, 0, GTK_PACK_START); | |
1662 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), | |
1663 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); | |
1664 | |
1665 sw = gtk_scrolled_window_new(NULL,NULL); | |
1666 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
1667 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1668 | |
1669 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
1670 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); | |
1671 | |
1672 for (j=0; j < GAIM_NUM_SOUNDS; j++) { | |
1673 char *pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", | |
1674 gaim_gtk_sound_get_event_option(j)); | |
1675 const char *label = gaim_gtk_sound_get_event_label(j); | |
1676 | |
1677 if (label == NULL) { | |
1678 g_free(pref); | |
1679 continue; | |
1680 } | |
1681 | |
1682 gtk_list_store_append (event_store, &iter); | |
1683 gtk_list_store_set(event_store, &iter, | |
1684 0, gaim_prefs_get_bool(pref), | |
1685 1, _(label), | |
1686 2, pref, | |
1687 3, j, | |
1688 -1); | |
1689 g_free(pref); | |
1690 } | |
1691 | |
1692 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
1693 | |
1694 rend = gtk_cell_renderer_toggle_new(); | |
1695 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1696 g_signal_connect (G_OBJECT (sel), "changed", | |
1697 G_CALLBACK (prefs_sound_sel), | |
1698 NULL); | |
1699 g_signal_connect (G_OBJECT(rend), "toggled", | |
1700 G_CALLBACK(event_toggled), event_store); | |
1701 path = gtk_tree_path_new_first(); | |
1702 gtk_tree_selection_select_path(sel, path); | |
1703 gtk_tree_path_free(path); | |
1704 | |
1705 col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
1706 rend, | |
1707 "active", 0, | |
1708 NULL); | |
1709 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1710 | |
1711 rend = gtk_cell_renderer_text_new(); | |
1712 col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
1713 rend, | |
1714 "text", 1, | |
1715 NULL); | |
1716 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1717 g_object_unref(G_OBJECT(event_store)); | |
1718 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1719 | |
1720 hbox = gtk_hbox_new(FALSE, 6); | |
1721 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1722 sound_entry = gtk_entry_new(); | |
1723 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
1724 gaim_gtk_sound_get_event_option(0)); | |
1725 file = gaim_prefs_get_string(pref); | |
1726 g_free(pref); | |
1727 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); | |
1728 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); | |
1729 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
1730 | |
1731 button = gtk_button_new_with_label(_("Test")); | |
1732 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
1733 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1734 | |
1735 button = gtk_button_new_with_label(_("Reset")); | |
1736 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
1737 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
1738 | |
1739 button = gtk_button_new_with_label(_("Choose...")); | |
9508 | 1740 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL); |
9150 | 1741 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
5440 | 1742 gtk_widget_show_all(ret); |
9118 | 1743 |
10075 | 1744 #ifndef _WIN32 |
10074 | 1745 gtk_widget_set_sensitive(vbox, |
1746 strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), "none")); | |
10087 | 1747 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method", |
1748 sound_changed2_cb, vbox); | |
10075 | 1749 #endif |
10074 | 1750 |
5440 | 1751 return ret; |
1752 } | |
1753 | |
1754 GtkWidget *away_page() { | |
1755 GtkWidget *ret; | |
1756 GtkWidget *vbox; | |
1757 GtkWidget *hbox; | |
1758 GtkWidget *label; | |
1759 GtkWidget *button; | |
1760 GtkWidget *select; | |
1761 GtkWidget *dd; | |
1762 GtkSizeGroup *sg; | |
1763 | |
1764 ret = gtk_vbox_new(FALSE, 18); | |
1765 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1766 | |
1767 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1768 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1769 vbox = gaim_gtk_make_frame (ret, _("Away")); |
7987 | 1770 gaim_gtk_prefs_checkbox(_("_Queue new messages when away"), |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
1771 "/gaim/gtk/away/queue_messages", vbox); |
5440 | 1772 |
9596 | 1773 label = gaim_gtk_prefs_dropdown(vbox, _("_Auto-reply:"), |
1774 GAIM_PREF_STRING, "/core/away/auto_reply", | |
1775 _("Never"), "never", | |
9736 | 1776 _("When away"), "away", |
1777 _("When away and idle"), "awayidle", | |
9596 | 1778 NULL); |
6142 | 1779 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1780 vbox = gaim_gtk_make_frame (ret, _("Idle")); |
7987 | 1781 dd = gaim_gtk_prefs_dropdown(vbox, _("Idle _time reporting:"), |
1782 GAIM_PREF_STRING, "/gaim/gtk/idle/reporting_method", | |
1783 _("None"), "none", | |
1784 _("Gaim usage"), "gaim", | |
5440 | 1785 #ifdef USE_SCREENSAVER |
1786 #ifndef _WIN32 | |
7987 | 1787 _("X usage"), "system", |
5440 | 1788 #else |
7987 | 1789 _("Windows usage"), "system", |
5440 | 1790 #endif |
1791 #endif | |
7987 | 1792 NULL); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1793 |
5440 | 1794 gtk_size_group_add_widget(sg, dd); |
1795 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1796 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1797 vbox = gaim_gtk_make_frame (ret, _("Auto-away")); |
7987 | 1798 button = gaim_gtk_prefs_checkbox(_("Set away _when idle"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1799 "/core/away/away_when_idle", vbox); |
8238 | 1800 |
7987 | 1801 select = gaim_gtk_prefs_labeled_spin_button(vbox, |
1802 _("_Minutes before setting away:"), "/core/away/mins_before_away", | |
1803 1, 24 * 60, sg); | |
5440 | 1804 g_signal_connect(G_OBJECT(button), "clicked", |
1805 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
1806 | |
8238 | 1807 hbox = gtk_hbox_new(FALSE, 0); |
1808 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1809 | |
5440 | 1810 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
1811 gtk_size_group_add_widget(sg, label); | |
1812 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
8238 | 1813 g_signal_connect(G_OBJECT(button), "clicked", |
1814 G_CALLBACK(gaim_gtk_toggle_sensitive), label); | |
5440 | 1815 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
8238 | 1816 |
5440 | 1817 prefs_away_menu = gtk_option_menu_new(); |
1818 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); | |
1819 g_signal_connect(G_OBJECT(button), "clicked", | |
1820 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); | |
1821 default_away_menu_init(prefs_away_menu); | |
1822 gtk_widget_show(prefs_away_menu); | |
1823 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
8238 | 1824 gaim_set_accessible_label (prefs_away_menu, label); |
1825 | |
5440 | 1826 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1827 if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1828 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
8238 | 1829 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1830 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1831 } |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1832 |
5440 | 1833 gtk_widget_show_all(ret); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1834 |
5440 | 1835 return ret; |
1836 } | |
1837 | |
1838 static GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
1839 | |
1840 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
1841 { | |
1842 gchar *buf, *pname, *perr, *pdesc, *pauth, *pweb; | |
1843 GtkTreeIter iter; | |
1844 GValue val = { 0, }; | |
1845 GaimPlugin *plug; | |
1846 | |
1847 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1848 return; | |
8104 | 1849 gtk_tree_model_get_value (model, &iter, 3, &val); |
5440 | 1850 plug = g_value_get_pointer(&val); |
8998 | 1851 |
5440 | 1852 pname = g_markup_escape_text(_(plug->info->name), -1); |
9307 | 1853 pdesc = (plug->info->description) ? |
1854 g_markup_escape_text(_(plug->info->description), -1) : NULL; | |
1855 pauth = (plug->info->author) ? | |
1856 g_markup_escape_text(_(plug->info->author), -1) : NULL; | |
1857 pweb = (plug->info->homepage) ? | |
1858 g_markup_escape_text(_(plug->info->homepage), -1) : NULL; | |
1859 | |
5440 | 1860 if (plug->error != NULL) { |
1861 perr = g_markup_escape_text(_(plug->error), -1); | |
1862 buf = g_strdup_printf( | |
1863 "<span size=\"larger\">%s %s</span>\n\n" | |
1864 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1865 "%s", | |
1866 pname, plug->info->version, perr, pdesc); | |
1867 g_free(perr); | |
1868 } | |
1869 else { | |
1870 buf = g_strdup_printf( | |
1871 "<span size=\"larger\">%s %s</span>\n\n%s", | |
1872 pname, plug->info->version, pdesc); | |
1873 } | |
1874 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1875 g_free(buf); | |
1876 | |
1877 buf = g_strdup_printf( | |
1878 #ifndef _WIN32 | |
1879 _("<span size=\"larger\">%s %s</span>\n\n" | |
1880 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
1881 "<span weight=\"bold\">Web site:</span>\t\t%s\n" | |
1882 "<span weight=\"bold\">File name:</span>\t%s"), | |
1883 #else | |
1884 _("<span size=\"larger\">%s %s</span>\n\n" | |
1885 "<span weight=\"bold\">Written by:</span> %s\n" | |
1886 "<span weight=\"bold\">URL:</span> %s\n" | |
1887 "<span weight=\"bold\">File name:</span> %s"), | |
1888 #endif | |
1889 pname, plug->info->version, pauth, pweb, plug->path); | |
1890 | |
1891 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
1892 g_value_unset(&val); | |
1893 g_free(buf); | |
1894 g_free(pname); | |
1895 g_free(pdesc); | |
1896 g_free(pauth); | |
1897 g_free(pweb); | |
1898 } | |
1899 | |
1900 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1901 { | |
1902 GtkTreeModel *model = (GtkTreeModel *)data; | |
1903 GtkTreeIter iter; | |
1904 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1905 GaimPlugin *plug; | |
1906 gchar buf[1024]; | |
6040 | 1907 gchar *name = NULL, *description = NULL; |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1908 |
5440 | 1909 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1910 gdk_window_set_cursor(prefs->window, wait); | |
1911 gdk_cursor_unref(wait); | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1912 |
5440 | 1913 gtk_tree_model_get_iter (model, &iter, path); |
8104 | 1914 gtk_tree_model_get (model, &iter, 3, &plug, -1); |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
1915 |
5440 | 1916 if (!gaim_plugin_is_loaded(plug)) { |
1917 gaim_plugin_load(plug); | |
1918 | |
1919 /* | |
1920 * NOTE: This is basically the same check as before | |
1921 * (plug->type == plugin), but now there aren't plugin types. | |
1922 * Not yet, anyway. I want to do a V2 of the plugin API. | |
1923 * The thing is, we should have a flag specifying the UI type, | |
1924 * or just whether it's a general plugin or a UI-specific | |
1925 * plugin. We should only load this if it's UI-specific. | |
1926 * | |
1927 * -- ChipX86 | |
1928 */ | |
1929 if (GAIM_IS_GTK_PLUGIN(plug)) | |
1930 { | |
1931 GtkWidget *config_frame; | |
1932 GaimGtkPluginUiInfo *ui_info; | |
1933 | |
1934 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1935 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
1936 | |
1937 if (config_frame != NULL) { | |
1938 ui_info->iter = g_new0(GtkTreeIter, 1); | |
1939 prefs_notebook_add_page(_(plug->info->name), NULL, | |
10078 | 1940 config_frame, ui_info->iter, |
1941 &plugin_iter, notebook_page++); | |
5440 | 1942 } |
1943 } | |
8713 | 1944 |
1945 if(GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { | |
8998 | 1946 GtkTreeIter iter; |
8713 | 1947 GtkWidget *pref_frame; |
1948 GaimPluginUiInfo *prefs_info; | |
1949 | |
1950 if(plug->info->type == GAIM_PLUGIN_PROTOCOL) | |
1951 iter = proto_iter; | |
1952 else | |
1953 iter = plugin_iter; | |
1954 | |
1955 prefs_info = GAIM_PLUGIN_UI_INFO(plug); | |
8814 | 1956 prefs_info->frame = prefs_info->get_plugin_pref_frame(plug); |
1957 pref_frame = gaim_gtk_plugin_pref_create_frame(prefs_info->frame); | |
8713 | 1958 |
1959 if(pref_frame != NULL) { | |
1960 prefs_info->iter = g_new0(GtkTreeIter, 1); | |
1961 prefs_notebook_add_page(_(plug->info->name), NULL, | |
1962 pref_frame, prefs_info->iter, | |
1963 &iter, notebook_page++); | |
1964 } | |
1965 } | |
5440 | 1966 } |
1967 else { | |
1968 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
1969 GaimGtkPluginUiInfo *ui_info; | |
1970 | |
1971 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1972 | |
1973 if (ui_info != NULL && ui_info->iter != NULL) { | |
1974 g_free(ui_info->iter); | |
1975 ui_info->iter = NULL; | |
1976 } | |
8745 | 1977 } |
1978 | |
1979 if (GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { | |
8713 | 1980 GaimPluginUiInfo *prefs_info; |
1981 | |
1982 prefs_info = GAIM_PLUGIN_UI_INFO(plug); | |
1983 | |
8745 | 1984 if(prefs_info != NULL) { |
8814 | 1985 if(prefs_info->frame != NULL) { |
1986 gaim_plugin_pref_frame_destroy(prefs_info->frame); | |
1987 prefs_info->frame = NULL; | |
1988 } | |
1989 | |
8745 | 1990 if(prefs_info->iter != NULL) { |
1991 g_free(prefs_info->iter); | |
1992 prefs_info->iter = NULL; | |
1993 } | |
8713 | 1994 } |
5440 | 1995 } |
1996 | |
1997 gaim_plugin_unload(plug); | |
1998 } | |
1999 | |
2000 gdk_window_set_cursor(prefs->window, NULL); | |
2001 | |
6040 | 2002 name = g_markup_escape_text(_(plug->info->name), -1); |
2003 description = g_markup_escape_text(_(plug->info->description), -1); | |
5440 | 2004 if (plug->error != NULL) { |
6040 | 2005 gchar *error = g_markup_escape_text(plug->error, -1); |
5440 | 2006 g_snprintf(buf, sizeof(buf), |
2007 "<span size=\"larger\">%s %s</span>\n\n" | |
2008 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
2009 "%s", | |
6040 | 2010 name, plug->info->version, error, description); |
2011 g_free(error); | |
2012 } else { | |
5440 | 2013 g_snprintf(buf, sizeof(buf), |
2014 "<span size=\"larger\">%s %s</span>\n\n%s", | |
6040 | 2015 name, plug->info->version, description); |
5440 | 2016 } |
6040 | 2017 g_free(name); |
2018 g_free(description); | |
5440 | 2019 |
2020 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
2021 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, | |
2022 gaim_plugin_is_loaded(plug), -1); | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2023 |
5440 | 2024 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
2025 gtk_tree_path_free(path); | |
5981
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
2026 |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
2027 gaim_gtk_plugins_save(); |
5440 | 2028 } |
2029 | |
2030 static void | |
2031 update_plugin_list(void *data) | |
2032 { | |
2033 GtkListStore *ls = GTK_LIST_STORE(data); | |
2034 GtkTreeIter iter; | |
2035 GList *probes; | |
2036 GaimPlugin *plug; | |
2037 | |
2038 gtk_list_store_clear(ls); | |
2039 | |
2040 for (probes = gaim_plugins_get_all(); | |
2041 probes != NULL; | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2042 probes = probes->next) |
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2043 { |
5440 | 2044 plug = probes->data; |
2045 | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2046 if (plug->info->type != GAIM_PLUGIN_STANDARD || |
6930
31c45d99e1a8
[gaim-migrate @ 7477]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
2047 (plug->info->flags & GAIM_PLUGIN_FLAG_INVISIBLE)) |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2048 { |
5440 | 2049 continue; |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2050 } |
5440 | 2051 |
2052 gtk_list_store_append (ls, &iter); | |
2053 gtk_list_store_set(ls, &iter, | |
2054 0, gaim_plugin_is_loaded(plug), | |
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6861
diff
changeset
|
2055 1, plug->info->name ? _(plug->info->name) : plug->path, |
8162 | 2056 2, _(plug->info->summary), |
8104 | 2057 3, plug, -1); |
5440 | 2058 } |
2059 } | |
2060 | |
2061 static GtkWidget *plugin_page () | |
2062 { | |
2063 GtkWidget *ret; | |
2064 GtkWidget *sw, *vp; | |
2065 GtkWidget *event_view; | |
2066 GtkListStore *ls; | |
2067 GtkCellRenderer *rend, *rendt; | |
2068 GtkTreeViewColumn *col; | |
2069 GtkTreeSelection *sel; | |
2070 GtkTreePath *path; | |
2071 GtkWidget *nb; | |
2072 | |
2073 ret = gtk_vbox_new(FALSE, 18); | |
2074 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2075 | |
2076 sw = gtk_scrolled_window_new(NULL,NULL); | |
8104 | 2077 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
5440 | 2078 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
2079 | |
2080 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
2081 | |
8104 | 2082 ls = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); |
7939 | 2083 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), |
2084 1, GTK_SORT_ASCENDING); | |
5440 | 2085 |
2086 update_plugin_list(ls); | |
2087 | |
2088 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
2089 | |
2090 rend = gtk_cell_renderer_toggle_new(); | |
2091 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
2092 | |
2093 col = gtk_tree_view_column_new_with_attributes (_("Load"), | |
2094 rend, | |
2095 "active", 0, | |
2096 NULL); | |
2097 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2098 | |
2099 rendt = gtk_cell_renderer_text_new(); | |
2100 col = gtk_tree_view_column_new_with_attributes (_("Name"), | |
2101 rendt, | |
2102 "text", 1, | |
2103 NULL); | |
2104 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
8998 | 2105 |
8104 | 2106 rendt = gtk_cell_renderer_text_new(); |
2107 col = gtk_tree_view_column_new_with_attributes(_("Summary"), | |
2108 rendt, | |
2109 "text", 2, | |
2110 NULL); | |
2111 gtk_tree_view_append_column(GTK_TREE_VIEW(event_view), col); | |
8998 | 2112 |
5440 | 2113 g_object_unref(G_OBJECT(ls)); |
2114 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
8998 | 2115 |
5440 | 2116 |
2117 nb = gtk_notebook_new(); | |
2118 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
2119 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
8998 | 2120 |
5440 | 2121 /* Description */ |
2122 sw = gtk_scrolled_window_new(NULL, NULL); | |
2123 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2124 plugin_description = gtk_label_new(NULL); | |
8998 | 2125 |
5440 | 2126 vp = gtk_viewport_new(NULL, NULL); |
2127 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
2128 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
2129 | |
2130 gtk_container_add(GTK_CONTAINER(vp), plugin_description); | |
2131 gtk_container_add(GTK_CONTAINER(sw), vp); | |
2132 | |
8998 | 2133 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
5440 | 2134 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); |
2135 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); | |
2136 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
2137 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
2138 | |
2139 /* Details */ | |
2140 sw = gtk_scrolled_window_new(NULL, NULL); | |
2141 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
2142 plugin_details = gtk_label_new(NULL); | |
8998 | 2143 |
5440 | 2144 vp = gtk_viewport_new(NULL, NULL); |
2145 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
2146 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
2147 | |
2148 gtk_container_add(GTK_CONTAINER(vp), plugin_details); | |
2149 gtk_container_add(GTK_CONTAINER(sw), vp); | |
2150 | |
8998 | 2151 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
5440 | 2152 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); |
2153 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); | |
8998 | 2154 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); |
5440 | 2155 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); |
2156 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
2157 | |
2158 g_signal_connect (G_OBJECT (sel), "changed", | |
2159 G_CALLBACK (prefs_plugin_sel), | |
8998 | 2160 NULL); |
5440 | 2161 g_signal_connect (G_OBJECT(rend), "toggled", |
2162 G_CALLBACK(plugin_load), ls); | |
2163 | |
2164 path = gtk_tree_path_new_first(); | |
2165 gtk_tree_selection_select_path(sel, path); | |
2166 gtk_tree_path_free(path); | |
2167 | |
2168 gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); | |
2169 | |
2170 gtk_widget_show_all(ret); | |
2171 return ret; | |
2172 } | |
2173 | |
2174 GtkTreeIter *prefs_notebook_add_page(const char *text, | |
2175 GdkPixbuf *pixbuf, | |
2176 GtkWidget *page, | |
2177 GtkTreeIter *iter, | |
2178 GtkTreeIter *parent, | |
2179 int ind) { | |
2180 GdkPixbuf *icon = NULL; | |
2181 | |
2182 if (pixbuf) | |
2183 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); | |
2184 | |
2185 if (pixbuf) | |
2186 g_object_unref(pixbuf); | |
2187 if (icon) | |
2188 g_object_unref(icon); | |
2189 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
2190 return iter; | |
2191 } | |
2192 | |
2193 void prefs_notebook_init() { | |
9267 | 2194 GtkTreeIter p, c, c2; |
5440 | 2195 GList *l; |
2196 GaimPlugin *plug; | |
2197 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
2198 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
9150 | 2199 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &c, &p, notebook_page++); |
9267 | 2200 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c2, &c, notebook_page++); |
2201 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c2, &c, notebook_page++); | |
2202 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c2, &c, notebook_page++); | |
9150 | 2203 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &c, &p, notebook_page++); |
8238 | 2204 prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++); |
5440 | 2205 #ifndef _WIN32 |
2206 /* We use the registered default browser in windows */ | |
10060 | 2207 /* if the user is running gnome 2.x, hide the browsers tab */ |
10061 | 2208 if (gaim_running_gnome() == FALSE) { |
10060 | 2209 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
2210 } | |
5440 | 2211 #endif |
2212 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); | |
2213 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
2214 | |
2215 if (gaim_plugins_enabled()) { | |
2216 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); | |
2217 | |
2218 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
8713 | 2219 plug = (GaimPlugin *)l->data; |
5440 | 2220 |
2221 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
2222 GtkWidget *config_frame; | |
2223 GaimGtkPluginUiInfo *ui_info; | |
2224 | |
2225 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
2226 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
2227 | |
2228 if (config_frame != NULL) { | |
2229 ui_info->iter = g_new0(GtkTreeIter, 1); | |
2230 prefs_notebook_add_page(_(plug->info->name), NULL, | |
2231 config_frame, ui_info->iter, | |
2232 &plugin_iter, notebook_page++); | |
2233 } | |
2234 } | |
8713 | 2235 |
2236 if(GAIM_PLUGIN_HAS_PREF_FRAME(plug)) { | |
8745 | 2237 GtkWidget *gtk_frame; |
8713 | 2238 GaimPluginUiInfo *prefs_info; |
2239 | |
2240 prefs_info = GAIM_PLUGIN_UI_INFO(plug); | |
8814 | 2241 prefs_info->frame = prefs_info->get_plugin_pref_frame(plug); |
2242 gtk_frame = gaim_gtk_plugin_pref_create_frame(prefs_info->frame); | |
8745 | 2243 |
2244 if(GTK_IS_WIDGET(gtk_frame)) { | |
8713 | 2245 prefs_info->iter = g_new0(GtkTreeIter, 1); |
2246 prefs_notebook_add_page(_(plug->info->name), NULL, | |
8745 | 2247 gtk_frame, prefs_info->iter, |
9150 | 2248 (plug->info->type == GAIM_PLUGIN_PROTOCOL) ? NULL : &plugin_iter, |
8713 | 2249 notebook_page++); |
8814 | 2250 } else if(prefs_info->frame) { |
2251 /* in the event that there is a pref frame and we can | |
2252 * not make a widget out of it, we free the | |
2253 * pluginpref frame --Gary | |
2254 */ | |
2255 gaim_plugin_pref_frame_destroy(prefs_info->frame); | |
8713 | 2256 } |
2257 } | |
5440 | 2258 } |
2259 } | |
2260 } | |
2261 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2262 void gaim_gtk_prefs_show(void) |
5440 | 2263 { |
10078 | 2264 GtkWidget *vbox; |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2265 GtkWidget *bbox; |
5440 | 2266 GtkWidget *notebook; |
2267 GtkWidget *button; | |
2268 | |
2269 if (prefs) { | |
2270 gtk_window_present(GTK_WINDOW(prefs)); | |
2271 return; | |
2272 } | |
2273 | |
2274 /* copy the preferences to tmp values... | |
2275 * I liked "take affect immediately" Oh well :-( */ | |
6016 | 2276 /* (that should have been "effect," right?) */ |
2277 | |
5440 | 2278 /* Back to instant-apply! I win! BU-HAHAHA! */ |
2279 | |
2280 /* Create the window */ | |
2281 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
2282 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); | |
2283 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); | |
2284 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); | |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2285 gtk_container_set_border_width(GTK_CONTAINER(prefs), 12); |
5440 | 2286 g_signal_connect(G_OBJECT(prefs), "destroy", |
2287 G_CALLBACK(delete_prefs), NULL); | |
2288 | |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2289 vbox = gtk_vbox_new(FALSE, 12); |
5440 | 2290 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
2291 gtk_widget_show(vbox); | |
2292 | |
2293 /* The notebook */ | |
2294 prefsnotebook = notebook = gtk_notebook_new (); | |
10078 | 2295 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_LEFT); |
2296 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), TRUE); | |
5440 | 2297 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); |
10078 | 2298 gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0); |
2299 | |
5440 | 2300 |
8713 | 2301 /* The buttons to press! */ |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2302 bbox = gtk_hbutton_box_new(); |
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2303 gtk_box_set_spacing(GTK_BOX(bbox), 6); |
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2304 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
|
2305 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); |
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2306 gtk_widget_show (bbox); |
5440 | 2307 |
2308 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); | |
2309 g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
2310 G_CALLBACK(gtk_widget_destroy), prefs); | |
8292
90ed519c6645
[gaim-migrate @ 9016]
Christian Hammond <chipx86@chipx86.com>
parents:
8283
diff
changeset
|
2311 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); |
5440 | 2312 gtk_widget_show(button); |
2313 | |
2314 prefs_notebook_init(); | |
2315 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2316 /* Show everything. */ |
10078 | 2317 gtk_widget_show_all(prefs); |
5440 | 2318 } |
2319 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2320 static void |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2321 set_bool_pref(GtkWidget *w, const char *key) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2322 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2323 gaim_prefs_set_bool(key, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2324 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2325 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2326 |
7976 | 2327 GtkWidget * |
7987 | 2328 gaim_gtk_prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
5440 | 2329 { |
2330 GtkWidget *button; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2331 |
5440 | 2332 button = gtk_check_button_new_with_mnemonic(text); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2333 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2334 gaim_prefs_get_bool(key)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2335 |
5440 | 2336 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
|
2337 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2338 g_signal_connect(G_OBJECT(button), "clicked", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2339 G_CALLBACK(set_bool_pref), (char *)key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2340 |
5440 | 2341 gtk_widget_show(button); |
2342 | |
2343 return button; | |
2344 } | |
2345 | |
2346 void default_away_menu_init(GtkWidget *omenu) | |
2347 { | |
9944 | 2348 GtkWidget *menu; |
2349 /* XXX CORE/UI | |
2350 GtkWidget *opt; | |
6216 | 2351 int index = 0, default_index = 0; |
5440 | 2352 GSList *awy = away_messages; |
2353 struct away_message *a; | |
9944 | 2354 */ |
6216 | 2355 const char *default_name; |
5440 | 2356 |
2357 menu = gtk_menu_new(); | |
2358 | |
6216 | 2359 default_name = gaim_prefs_get_string("/core/away/default_message"); |
2360 | |
9944 | 2361 /* XXX CORE/UI |
5440 | 2362 while (awy) { |
2363 a = (struct away_message *)awy->data; | |
2364 opt = gtk_menu_item_new_with_label(a->name); | |
2365 g_signal_connect(G_OBJECT(opt), "activate", | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2366 G_CALLBACK(set_default_away), GINT_TO_POINTER(index)); |
5440 | 2367 gtk_widget_show(opt); |
2368 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
2369 | |
6216 | 2370 if(!strcmp(default_name, a->name)) |
2371 default_index = index; | |
2372 | |
5440 | 2373 awy = awy->next; |
2374 index++; | |
2375 } | |
9944 | 2376 */ |
5440 | 2377 |
2378 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2379 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
9944 | 2380 |
2381 /* XXX CORE/UI | |
6216 | 2382 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), default_index); |
9944 | 2383 */ |
5440 | 2384 } |
2385 | |
9944 | 2386 /* XXX CORE/UI */ |
2387 #if 0 | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2388 void set_default_away(GtkWidget *w, gpointer data) |
5440 | 2389 { |
6216 | 2390 struct away_message *default_away = NULL; |
5440 | 2391 int length = g_slist_length(away_messages); |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2392 int i = GPOINTER_TO_INT(data); |
5440 | 2393 |
2394 if (away_messages == NULL) | |
2395 default_away = NULL; | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2396 else if (i >= length) |
5440 | 2397 default_away = g_slist_nth_data(away_messages, length - 1); |
2398 else | |
6478
338147ea6896
[gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents:
6455
diff
changeset
|
2399 default_away = g_slist_nth_data(away_messages, i); |
6216 | 2400 |
2401 if(default_away) | |
2402 gaim_prefs_set_string("/core/away/default_message", default_away->name); | |
2403 else | |
2404 gaim_prefs_set_string("/core/away/default_message", ""); | |
5440 | 2405 } |
9944 | 2406 #endif |
5440 | 2407 |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2408 static void |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2409 smiley_theme_pref_cb(const char *name, GaimPrefType type, gpointer value, |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2410 gpointer data) |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2411 { |
5841 | 2412 if (!strcmp(name, "/gaim/gtk/smileys/theme")) |
5771
f63a008726c6
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2413 load_smiley_theme((const char *)value, TRUE); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2414 } |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2415 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2416 void |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2417 gaim_gtk_prefs_init(void) |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2418 { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2419 gaim_prefs_add_none("/gaim"); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2420 gaim_prefs_add_none("/gaim/gtk"); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2421 gaim_prefs_add_none("/plugins/gtk"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2422 |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2423 /* XXX Move this! HACK! :( Aww... */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2424 gaim_prefs_add_none("/plugins/gtk/docklet"); |
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5551
diff
changeset
|
2425 gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2426 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2427 /* Accounts Dialog */ |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2428 gaim_prefs_add_none("/gaim/gtk/accounts"); |
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2429 gaim_prefs_add_none("/gaim/gtk/accounts/dialog"); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2430 gaim_prefs_add_int("/gaim/gtk/accounts/dialog/width", 550); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2431 gaim_prefs_add_int("/gaim/gtk/accounts/dialog/height", 250); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2432 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2433 /* Away Queueing */ |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2434 gaim_prefs_add_none("/gaim/gtk/away"); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2435 gaim_prefs_add_bool("/gaim/gtk/away/queue_messages", FALSE); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2436 |
8283 | 2437 #ifndef _WIN32 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2438 /* Browsers */ |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2439 gaim_prefs_add_none("/gaim/gtk/browsers"); |
8272 | 2440 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
|
2441 gaim_prefs_add_string("/gaim/gtk/browsers/command", ""); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2442 gaim_prefs_add_string("/gaim/gtk/browsers/browser", "mozilla"); |
8283 | 2443 #endif |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2444 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2445 /* Idle */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2446 gaim_prefs_add_none("/gaim/gtk/idle"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2447 gaim_prefs_add_string("/gaim/gtk/idle/reporting_method", "system"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2448 |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2449 /* Plugins */ |
5982
35d3c1ac5ece
[gaim-migrate @ 6430]
Christian Hammond <chipx86@chipx86.com>
parents:
5981
diff
changeset
|
2450 gaim_prefs_add_none("/gaim/gtk/plugins"); |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2451 gaim_prefs_add_string_list("/gaim/gtk/plugins/loaded", NULL); |
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2452 |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2453 /* Smiley Themes */ |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2454 gaim_prefs_add_none("/gaim/gtk/smileys"); |
9707 | 2455 gaim_prefs_add_string("/gaim/gtk/smileys/theme", "default"); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2456 |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2457 /* Smiley Callbacks */ |
10087 | 2458 gaim_prefs_connect_callback(prefs, "/gaim/gtk/smileys/theme", |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2459 smiley_theme_pref_cb, NULL); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2460 } |
8905 | 2461 |
2462 void gaim_gtk_prefs_update_old() { | |
2463 /* Rename some old prefs */ | |
2464 gaim_prefs_rename("/gaim/gtk/logging/log_ims", "/core/logging/log_ims"); | |
2465 gaim_prefs_rename("/gaim/gtk/logging/log_chats", "/core/logging/log_chats"); | |
2466 gaim_prefs_rename("/core/conversations/placement", | |
8998 | 2467 "/gaim/gtk/conversations/placement"); |
8905 | 2468 |
9025 | 2469 gaim_prefs_rename("/gaim/gtk/conversations/use_custom_font", |
2470 "/gaim/gtk/conversations/send_formatting"); | |
2471 | |
9150 | 2472 gaim_prefs_rename("/gaim/gtk/conversations/im/button_type", |
2473 "/gaim/gtk/conversations/button_type"); | |
2474 | |
8905 | 2475 /* Remove some no-longer-used prefs */ |
10133 | 2476 gaim_prefs_remove("/gaim/gtk/blist/button_style"); |
2477 gaim_prefs_remove("/gaim/gtk/blist/raise_on_events"); | |
8945 | 2478 gaim_prefs_remove("/gaim/gtk/blist/show_group_count"); |
8946 | 2479 gaim_prefs_remove("/gaim/gtk/conversations/icons_on_tabs"); |
8905 | 2480 gaim_prefs_remove("/gaim/gtk/conversations/show_urls_as_links"); |
2481 gaim_prefs_remove("/gaim/gtk/conversations/show_smileys"); | |
8941 | 2482 gaim_prefs_remove("/gaim/gtk/conversations/chat/tab_completion"); |
2483 gaim_prefs_remove("/gaim/gtk/conversations/chat/old_tab_complete"); | |
8947 | 2484 gaim_prefs_remove("/gaim/gtk/sound/signon"); |
2485 gaim_prefs_remove("/gaim/gtk/sound/silent_signon"); | |
8998 | 2486 gaim_prefs_remove("/gaim/gtk/logging/individual_logs"); |
9025 | 2487 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_bgcolor"); |
2488 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_fgcolor"); | |
2489 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_size"); | |
9301 | 2490 gaim_prefs_remove("/gaim/gtk/conversations/im/hide_on_send"); |
8905 | 2491 } |