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