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