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