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