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