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