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