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