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