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