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