Mercurial > pidgin.yaz
annotate src/gtkprefs.c @ 6089:97835d03f0bb
[gaim-migrate @ 6548]
Claudio Satriano
updated the it.po
added some _() to gtkconv.c
added some _() to server.c
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Fri, 11 Jul 2003 15:09:19 +0000 |
parents | 4314e6be74c4 |
children | 914f2d5da21c |
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); |
5440 | 801 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
802 vbox = gaim_gtk_make_frame(ret, _("Insertions")); |
6039 | 803 prefs_checkbox(_("Control-{B/I/U} inserts _HTML tags"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
804 "/gaim/gtk/conversations/html_shortcuts", vbox); |
5716 | 805 prefs_checkbox(_("Control-(number) _inserts smileys"), |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
806 "/gaim/gtk/conversations/smiley_shortcuts", vbox); |
5440 | 807 |
808 gtk_widget_show_all(ret); | |
809 return ret; | |
810 } | |
811 | |
812 GtkWidget *list_page() { | |
813 GtkWidget *ret; | |
814 GtkWidget *vbox; | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
815 GtkWidget *button, *warn_checkbox, *idle_checkbox; |
5440 | 816 GList *l= NULL; |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
817 GSList *sl; |
5440 | 818 ret = gtk_vbox_new(FALSE, 18); |
819 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
820 | |
821 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
822 vbox = gaim_gtk_make_frame (ret, _("Buddy List Sorting")); |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
823 |
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
824 for (sl = gaim_gtk_blist_sort_methods; sl != NULL; sl = sl->next) { |
5631 | 825 struct gaim_gtk_blist_sort_method *method = sl->data; |
826 | |
827 l = g_list_append(l, method->name); | |
828 l = g_list_append(l, method->id); | |
5440 | 829 } |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
830 |
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
831 prefs_dropdown_from_list(vbox, _("Sorting:"), GAIM_PREF_STRING, |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
832 "/gaim/gtk/blist/sort_type", l); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
833 |
5440 | 834 g_list_free(l); |
835 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
836 vbox = gaim_gtk_make_frame (ret, _("Buddy List Toolbar")); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
837 prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
838 "/gaim/gtk/blist/button_style", |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
839 _("Pictures"), GAIM_BUTTON_IMAGE, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
840 _("Text"), GAIM_BUTTON_TEXT, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
841 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
842 _("None"), GAIM_BUTTON_NONE, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
843 NULL); |
5440 | 844 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
845 vbox = gaim_gtk_make_frame (ret, _("Buddy List Window")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
846 prefs_checkbox(_("_Raise window on events"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
847 "/gaim/gtk/blist/raise_on_events", vbox); |
5440 | 848 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
849 vbox = gaim_gtk_make_frame (ret, _("Group Display")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
850 /* 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
|
851 prefs_checkbox(_("Show _numbers in groups"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
852 "/gaim/gtk/blist/show_group_count", vbox); |
5440 | 853 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
854 vbox = gaim_gtk_make_frame (ret, _("Buddy Display")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
855 button = prefs_checkbox(_("Show buddy _icons"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
856 "/gaim/gtk/blist/show_buddy_icons", vbox); |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
857 warn_checkbox = prefs_checkbox(_("Show _warning levels"), |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
858 "/gaim/gtk/blist/show_warning_level", vbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
859 |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
860 idle_checkbox = prefs_checkbox(_("Show idle _times"), |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
861 "/gaim/gtk/blist/show_idle_time", vbox); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
862 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
863 g_signal_connect(G_OBJECT(button), "clicked", |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
864 G_CALLBACK(gaim_gtk_toggle_sensitive), warn_checkbox); |
5440 | 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), idle_checkbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
867 |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
868 if (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) { |
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 gtk_widget_set_sensitive(GTK_WIDGET(warn_checkbox), FALSE); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
871 gtk_widget_set_sensitive(GTK_WIDGET(idle_checkbox), FALSE); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
872 } |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
873 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
874 prefs_checkbox(_("Dim i_dle buddies"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
875 "/gaim/gtk/blist/grey_idle_buddies", vbox); |
5440 | 876 |
877 gtk_widget_show_all(ret); | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
878 |
5440 | 879 return ret; |
880 } | |
881 | |
882 GtkWidget *conv_page() { | |
883 GtkWidget *ret; | |
884 GtkWidget *vbox; | |
885 GtkWidget *label; | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
886 GtkWidget *button, *close_checkbox; |
5440 | 887 GtkSizeGroup *sg; |
888 GList *names = NULL; | |
889 | |
890 ret = gtk_vbox_new(FALSE, 18); | |
891 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); | |
892 | |
893 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
894 vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
5440 | 895 |
5858 | 896 names = gaim_conv_placement_get_options(); |
5440 | 897 |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
898 label = prefs_dropdown_from_list(vbox, _("_Placement:"), GAIM_PREF_STRING, |
5858 | 899 "/core/conversations/placement", |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
900 names); |
5440 | 901 |
902 g_list_free(names); | |
903 | |
904 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
905 gtk_size_group_add_widget(sg, label); | |
906 | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
907 prefs_checkbox(_("Send _URLs as Links"), |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
908 "/core/conversations/send_urls_as_links", vbox); |
5440 | 909 |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
910 vbox = gaim_gtk_make_frame (ret, _("Tab Options")); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
911 |
5667 | 912 names = NULL; |
913 names = g_list_append(names, _("Top")); | |
914 names = g_list_append(names, GINT_TO_POINTER(GTK_POS_TOP)); | |
915 names = g_list_append(names, _("Bottom")); | |
916 names = g_list_append(names, GINT_TO_POINTER(GTK_POS_BOTTOM)); | |
917 names = g_list_append(names, _("Left")); | |
918 names = g_list_append(names, GINT_TO_POINTER(GTK_POS_LEFT)); | |
919 names = g_list_append(names, _("Right")); | |
920 names = g_list_append(names, GINT_TO_POINTER(GTK_POS_RIGHT)); | |
921 | |
5668 | 922 label = prefs_dropdown(vbox, _("_Tab Placement:"), GAIM_PREF_INT, |
5667 | 923 "/gaim/gtk/conversations/tab_side", |
5668 | 924 _("Top"), GTK_POS_TOP, |
925 _("Bottom"), GTK_POS_BOTTOM, | |
926 _("Left"), GTK_POS_LEFT, | |
927 _("Right"), GTK_POS_RIGHT, | |
928 NULL); | |
5667 | 929 |
930 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
931 gtk_size_group_add_widget(sg, label); | |
932 | |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
933 button = prefs_checkbox(_("Show IMs and chats in _tabbed windows"), |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
934 "/gaim/gtk/conversations/tabs", vbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
935 |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
936 close_checkbox = prefs_checkbox(_("Show _close button on tabs."), |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
937 "/gaim/gtk/conversations/close_on_tabs", |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
938 vbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
939 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
940 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) { |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
941 gtk_widget_set_sensitive(GTK_WIDGET(close_checkbox), FALSE); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
942 } |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
943 |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
944 g_signal_connect(G_OBJECT(button), "clicked", |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
945 G_CALLBACK(gaim_gtk_toggle_sensitive), close_checkbox); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
946 |
5440 | 947 gtk_widget_show_all(ret); |
948 | |
949 return ret; | |
950 } | |
951 | |
952 GtkWidget *im_page() { | |
953 GtkWidget *ret; | |
954 GtkWidget *vbox; | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
955 GtkWidget *widge; |
5440 | 956 GtkSizeGroup *sg; |
957 | |
958 ret = gtk_vbox_new(FALSE, 18); | |
959 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
960 | |
961 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
962 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
963 vbox = gaim_gtk_make_frame (ret, _("Window")); |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
964 widge = prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
965 "/gaim/gtk/conversations/im/button_type", |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
966 _("Pictures"), GAIM_BUTTON_IMAGE, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
967 _("Text"), GAIM_BUTTON_TEXT, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
968 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
969 NULL); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
970 |
5440 | 971 gtk_size_group_add_widget(sg, widge); |
972 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
973 prefs_labeled_spin_button(vbox, _("New window _width:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
974 "/gaim/gtk/conversations/im/default_width", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
975 25, 9999, sg); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
976 prefs_labeled_spin_button(vbox, _("New window _height:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
977 "/gaim/gtk/conversations/im/default_height", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
978 25, 9999, sg); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
979 prefs_labeled_spin_button(vbox, _("_Entry field height:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
980 "/gaim/gtk/conversations/im/entry_height", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
981 25, 9999, sg); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
982 prefs_checkbox(_("_Raise windows on events"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
983 "/gaim/gtk/conversations/im/raise_on_events", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
984 prefs_checkbox(_("Hide window on _send"), |
5631 | 985 "/gaim/gtk/conversations/im/hide_on_send", vbox); |
5440 | 986 gtk_widget_show (vbox); |
987 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
988 vbox = gaim_gtk_make_frame (ret, _("Buddy Icons")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
989 prefs_checkbox(_("Show buddy _icons"), |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
990 "/gaim/gtk/conversations/im/show_buddy_icons", vbox); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
991 prefs_checkbox(_("Enable buddy icon a_nimation"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
992 "/gaim/gtk/conversations/im/animate_buddy_icons", vbox); |
5440 | 993 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
994 vbox = gaim_gtk_make_frame (ret, _("Display")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
995 prefs_checkbox(_("Show _logins in window"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
996 "/core/conversations/im/show_login", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
997 prefs_checkbox(_("Show a_liases in tabs/titles"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
998 "/core/conversations/use_alias_for_title", vbox); |
5440 | 999 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1000 vbox = gaim_gtk_make_frame (ret, _("Typing Notification")); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1001 prefs_checkbox(_("Notify buddies that you are _typing to them"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1002 "/core/conversations/im/send_typing", vbox); |
5440 | 1003 |
1004 gtk_widget_show_all(ret); | |
1005 return ret; | |
1006 } | |
1007 | |
1008 GtkWidget *chat_page() { | |
1009 GtkWidget *ret; | |
1010 GtkWidget *vbox; | |
1011 GtkWidget *dd; | |
1012 GtkSizeGroup *sg; | |
1013 | |
1014 ret = gtk_vbox_new(FALSE, 18); | |
1015 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1016 | |
1017 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); | |
1018 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1019 vbox = gaim_gtk_make_frame (ret, _("Window")); |
5547
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1020 dd = prefs_dropdown(vbox, _("Show _buttons as:"), GAIM_PREF_INT, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1021 "/gaim/gtk/conversations/chat/button_type", |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1022 _("Pictures"), GAIM_BUTTON_IMAGE, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1023 _("Text"), GAIM_BUTTON_TEXT, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1024 _("Pictures and text"), GAIM_BUTTON_TEXT_IMAGE, |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1025 NULL); |
90a67ea697f7
[gaim-migrate @ 5948]
Christian Hammond <chipx86@chipx86.com>
parents:
5546
diff
changeset
|
1026 |
5440 | 1027 gtk_size_group_add_widget(sg, dd); |
1028 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1029 prefs_labeled_spin_button(vbox, _("New window _width:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1030 "/gaim/gtk/conversations/chat/default_width", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1031 25, 9999, sg); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1032 prefs_labeled_spin_button(vbox, _("New window _height:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1033 "/gaim/gtk/conversations/chat/default_height", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1034 25, 9999, sg); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1035 prefs_labeled_spin_button(vbox, _("_Entry field height:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1036 "/gaim/gtk/conversations/chat/entry_height", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1037 25, 9999, sg); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1038 prefs_checkbox(_("_Raise windows on events"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1039 "/gaim/gtk/conversations/chat/raise_on_events", vbox); |
5440 | 1040 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1041 vbox = gaim_gtk_make_frame (ret, _("Tab Completion")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1042 prefs_checkbox(_("_Tab-complete nicks"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1043 "/gaim/gtk/conversations/chat/tab_completion", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1044 prefs_checkbox(_("_Old-style tab completion"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1045 "/gaim/gtk/conversations/chat/old_tab_complete", vbox); |
5440 | 1046 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1047 vbox = gaim_gtk_make_frame (ret, _("Display")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1048 prefs_checkbox(_("_Show people joining in window"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1049 "/core/conversations/chat/show_join", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1050 prefs_checkbox(_("_Show people leaving in window"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1051 "/core/conversations/chat/show_leave", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1052 prefs_checkbox(_("Co_lorize screennames"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1053 "/gaim/gtk/conversations/chat/color_nicks", vbox); |
5440 | 1054 |
1055 gtk_widget_show_all(ret); | |
1056 return ret; | |
1057 } | |
1058 | |
6001 | 1059 static void |
1060 proxy_changed_cb(const char *name, GaimPrefType type, gpointer value, | |
1061 gpointer data) | |
1062 { | |
1063 GtkWidget *frame = data; | |
1064 const char *proxy = value; | |
1065 | |
1066 gtk_widget_set_sensitive(frame, strcmp(proxy, "none")); | |
1067 } | |
1068 | |
6006 | 1069 static void proxy_print_option(GtkEntry *entry, int entrynum) |
1070 { | |
1071 if (entrynum == PROXYHOST) | |
1072 gaim_prefs_set_string("/core/proxy/host", gtk_entry_get_text(entry)); | |
1073 else if (entrynum == PROXYPORT) | |
1074 gaim_prefs_set_int("/core/proxy/port", atoi(gtk_entry_get_text(entry))); | |
1075 else if (entrynum == PROXYUSER) | |
1076 gaim_prefs_set_string("/core/proxy/username", gtk_entry_get_text(entry)); | |
1077 else if (entrynum == PROXYPASS) | |
1078 gaim_prefs_set_string("/core/proxy/password", gtk_entry_get_text(entry)); | |
1079 | |
1080 /* If the user specifies it, we want to save it. */ | |
1081 gaim_global_proxy_set_from_prefs(TRUE); | |
1082 } | |
1083 | |
5440 | 1084 GtkWidget *proxy_page() { |
1085 GtkWidget *ret; | |
1086 GtkWidget *vbox; | |
1087 GtkWidget *entry; | |
1088 GtkWidget *label; | |
1089 GtkWidget *hbox; | |
1090 GtkWidget *table; | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1091 GaimProxyInfo *proxy_info; |
5440 | 1092 |
1093 ret = gtk_vbox_new(FALSE, 18); | |
1094 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1095 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1096 vbox = gaim_gtk_make_frame (ret, _("Proxy Type")); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1097 prefs_dropdown(vbox, _("Proxy _type:"), GAIM_PREF_STRING, |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1098 "/core/proxy/type", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1099 _("No proxy"), "none", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1100 "SOCKS 4", "socks4", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1101 "SOCKS 5", "socks5", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1102 "HTTP", "http", |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1103 NULL); |
5440 | 1104 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1105 vbox = gaim_gtk_make_frame(ret, _("Proxy Server")); |
5440 | 1106 prefs_proxy_frame = vbox; |
1107 | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1108 proxy_info = gaim_global_proxy_get_info(); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1109 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1110 if (proxy_info == NULL || |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1111 gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_NONE) { |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1112 |
6001 | 1113 gtk_widget_set_sensitive(GTK_WIDGET(prefs_proxy_frame), FALSE); |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1114 } |
6001 | 1115 proxy_pref_id = gaim_prefs_connect_callback("/core/proxy/type", |
1116 proxy_changed_cb, prefs_proxy_frame); | |
1117 | |
5440 | 1118 table = gtk_table_new(2, 4, FALSE); |
1119 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
1120 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
1121 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
1122 gtk_container_add(GTK_CONTAINER(vbox), table); | |
1123 | |
1124 | |
1125 label = gtk_label_new_with_mnemonic(_("_Host")); | |
1126 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
1127 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1128 | |
1129 entry = gtk_entry_new(); | |
1130 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1131 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); | |
1132 g_signal_connect(G_OBJECT(entry), "changed", | |
1133 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1134 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1135 if (proxy_info != NULL && gaim_proxy_info_get_host(proxy_info)) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1136 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1137 gaim_proxy_info_get_host(proxy_info)); |
5440 | 1138 |
1139 hbox = gtk_hbox_new(TRUE, 5); | |
1140 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1141 | |
1142 label = gtk_label_new_with_mnemonic(_("Port")); | |
1143 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
1144 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
1145 | |
1146 entry = gtk_entry_new(); | |
1147 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1148 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); | |
1149 g_signal_connect(G_OBJECT(entry), "changed", | |
1150 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); | |
1151 | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1152 if (proxy_info != NULL && gaim_proxy_info_get_port(proxy_info) != 0) { |
5440 | 1153 char buf[128]; |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1154 g_snprintf(buf, sizeof(buf), "%d", |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1155 gaim_proxy_info_get_port(proxy_info)); |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1156 |
5440 | 1157 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
1158 } | |
1159 | |
1160 label = gtk_label_new_with_mnemonic(_("_User")); | |
1161 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
1162 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
1163 | |
1164 entry = gtk_entry_new(); | |
1165 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1166 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); | |
1167 g_signal_connect(G_OBJECT(entry), "changed", | |
1168 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1169 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1170 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
|
1171 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1172 gaim_proxy_info_get_username(proxy_info)); |
5440 | 1173 |
1174 hbox = gtk_hbox_new(TRUE, 5); | |
1175 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
1176 | |
1177 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); | |
1178 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); | |
1179 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
1180 | |
1181 entry = gtk_entry_new(); | |
1182 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1183 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); | |
1184 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); | |
1185 g_signal_connect(G_OBJECT(entry), "changed", | |
1186 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); | |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1187 |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1188 if (proxy_info != NULL && gaim_proxy_info_get_password(proxy_info) != NULL) |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1189 gtk_entry_set_text(GTK_ENTRY(entry), |
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5673
diff
changeset
|
1190 gaim_proxy_info_get_password(proxy_info)); |
5440 | 1191 |
1192 gtk_widget_show_all(ret); | |
1193 return ret; | |
1194 } | |
1195 | |
1196 #ifndef _WIN32 | |
6016 | 1197 static gboolean program_is_valid(const char *program) |
1198 { | |
1199 GError *error = NULL; | |
1200 char **argv; | |
1201 gchar *progname; | |
1202 gboolean is_valid = FALSE; | |
1203 | |
1204 if (program == NULL || *program == '\0') { | |
1205 return FALSE; | |
1206 } | |
1207 | |
1208 if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
1209 gaim_debug(GAIM_DEBUG_ERROR, "program_is_valid", | |
1210 "Could not parse program '%s': %s\n", | |
1211 program, error->message); | |
1212 g_error_free(error); | |
1213 return FALSE; | |
1214 } | |
1215 | |
1216 if (argv == NULL) { | |
1217 return FALSE; | |
1218 } | |
1219 | |
1220 progname = g_find_program_in_path(argv[0]); | |
1221 is_valid = (progname != NULL); | |
1222 | |
1223 g_strfreev(argv); | |
1224 g_free(progname); | |
1225 | |
1226 return is_valid; | |
1227 } | |
1228 | |
5440 | 1229 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { |
1230 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
1231 | |
1232 if (!program_is_valid(program)) { | |
1233 char *error = g_strdup_printf(_("The entered manual browser " | |
1234 "'%s' is not valid. Hyperlinks will " | |
1235 "not work."), program); | |
1236 gaim_notify_warning(NULL, NULL, error, NULL); | |
1237 } | |
1238 | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1239 gaim_prefs_set_string("/gaim/gtk/browsers/command", program); |
5440 | 1240 |
1241 /* carry on normally */ | |
1242 return FALSE; | |
1243 } | |
1244 | |
5633 | 1245 static GList *get_available_browsers() |
5440 | 1246 { |
1247 struct browser { | |
1248 char *name; | |
1249 char *command; | |
1250 }; | |
1251 | |
1252 static struct browser possible_browsers[] = { | |
5633 | 1253 {N_("Opera"), "opera"}, |
1254 {N_("Netscape"), "netscape"}, | |
1255 {N_("Mozilla"), "mozilla"}, | |
6070 | 1256 {N_("Konqueror"), "kfmclient"}, |
1257 {N_("Galeon"), "galeon"} | |
5440 | 1258 }; |
1259 static const int num_possible_browsers = 5; | |
1260 | |
1261 GList *browsers = NULL; | |
1262 int i = 0; | |
5819 | 1263 char *browser_setting = (char *)gaim_prefs_get_string("/gaim/gtk/browsers/browser"); |
5440 | 1264 |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1265 browsers = g_list_prepend(browsers, "custom"); |
5440 | 1266 browsers = g_list_prepend(browsers, _("Manual")); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1267 |
5440 | 1268 for (i = 0; i < num_possible_browsers; i++) { |
1269 if (program_is_valid(possible_browsers[i].command)) { | |
5633 | 1270 browsers = g_list_prepend(browsers, |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1271 possible_browsers[i].command); |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1272 browsers = g_list_prepend(browsers, _(possible_browsers[i].name)); |
5825 | 1273 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting)) |
5819 | 1274 browser_setting = NULL; |
5440 | 1275 } |
1276 } | |
1277 | |
5819 | 1278 if(browser_setting) |
1279 gaim_prefs_set_string("/gaim/gtk/browsers/browser", "custom"); | |
1280 | |
5440 | 1281 return browsers; |
1282 } | |
1283 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1284 static void |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1285 browser_changed_cb(const char *name, GaimPrefType type, gpointer value, |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1286 gpointer data) |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1287 { |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1288 GtkWidget *hbox = data; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1289 const char *browser = value; |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1290 |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1291 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom")); |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1292 } |
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1293 |
5440 | 1294 GtkWidget *browser_page() { |
1295 GtkWidget *ret; | |
1296 GtkWidget *vbox; | |
1297 GtkWidget *hbox; | |
1298 GtkWidget *label; | |
6007 | 1299 GtkWidget *entry; |
5440 | 1300 GtkSizeGroup *sg; |
1301 GList *browsers = NULL; | |
1302 | |
1303 ret = gtk_vbox_new(FALSE, 18); | |
1304 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1305 | |
1306 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1307 vbox = gaim_gtk_make_frame (ret, _("Browser Selection")); |
5440 | 1308 |
1309 browsers = get_available_browsers(); | |
1310 if (browsers != NULL) { | |
6007 | 1311 label = prefs_dropdown_from_list(vbox,_("_Browser:"), GAIM_PREF_STRING, |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1312 "/gaim/gtk/browsers/browser", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1313 browsers); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1314 |
5440 | 1315 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
1316 gtk_size_group_add_widget(sg, label); | |
1317 } | |
1318 | |
1319 hbox = gtk_hbox_new(FALSE, 5); | |
1320 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
6031 | 1321 label = gtk_label_new_with_mnemonic(_("_Manual:\n(%s for URL)")); |
5440 | 1322 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
1323 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1324 gtk_size_group_add_widget(sg, label); | |
1325 | |
6007 | 1326 entry = gtk_entry_new(); |
1327 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1328 |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1329 if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom")) |
5440 | 1330 gtk_widget_set_sensitive(hbox, FALSE); |
6005 | 1331 browser_pref_id = gaim_prefs_connect_callback("/gaim/gtk/browsers/browser", |
1332 browser_changed_cb, hbox); | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1333 |
6007 | 1334 gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); |
1335 | |
1336 gtk_entry_set_text(GTK_ENTRY(entry), | |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1337 gaim_prefs_get_string("/gaim/gtk/browsers/command")); |
6007 | 1338 g_signal_connect(G_OBJECT(entry), "focus-out-event", |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
1339 G_CALLBACK(manual_browser_set), NULL); |
5440 | 1340 |
1341 if (browsers != NULL) { | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1342 vbox = gaim_gtk_make_frame (ret, _("Browser Options")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1343 label = prefs_checkbox(_("Open new _window by default"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1344 "/gaim/gtk/browsers/new_window", vbox); |
5440 | 1345 } |
1346 | |
1347 gtk_widget_show_all(ret); | |
1348 return ret; | |
1349 } | |
1350 #endif /*_WIN32*/ | |
1351 | |
1352 GtkWidget *logging_page() { | |
1353 GtkWidget *ret; | |
1354 GtkWidget *vbox; | |
1355 ret = gtk_vbox_new(FALSE, 18); | |
1356 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1357 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1358 vbox = gaim_gtk_make_frame (ret, _("Message Logs")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1359 prefs_checkbox(_("_Log all instant messages"), |
5635 | 1360 "/gaim/gtk/logging/log_ims", vbox); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1361 prefs_checkbox(_("Log all c_hats"), |
5635 | 1362 "/gaim/gtk/logging/log_chats", vbox); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1363 prefs_checkbox(_("Strip _HTML from logs"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1364 "/gaim/gtk/logging/strip_html", vbox); |
5440 | 1365 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1366 vbox = gaim_gtk_make_frame (ret, _("System Logs")); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1367 prefs_checkbox(_("Log when buddies _sign on/sign off"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1368 "/gaim/gtk/logging/log_signon_signoff", vbox); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1369 prefs_checkbox(_("Log when buddies become _idle/un-idle"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1370 "/gaim/gtk/logging/log_idle_state", vbox); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1371 prefs_checkbox(_("Log when buddies go away/come _back"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1372 "/gaim/gtk/logging/log_away_state", vbox); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1373 prefs_checkbox(_("Log your _own signons/idleness/awayness"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1374 "/gaim/gtk/logging/log_own_states", vbox); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1375 prefs_checkbox(_("I_ndividual log file for each buddy's signons"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1376 "/gaim/gtk/logging/individual_logs", vbox); |
5440 | 1377 |
1378 gtk_widget_show_all(ret); | |
1379 return ret; | |
1380 } | |
1381 | |
1382 #ifndef _WIN32 | |
1383 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) | |
1384 { | |
5684 | 1385 gaim_prefs_set_string("/gaim/gtk/sound/command", |
6007 | 1386 gtk_entry_get_text(GTK_ENTRY(entry))); |
5440 | 1387 return TRUE; |
1388 } | |
6005 | 1389 |
1390 static void | |
1391 sound_changed_cb(const char *name, GaimPrefType type, gpointer value, | |
1392 gpointer data) | |
1393 { | |
1394 GtkWidget *hbox = data; | |
1395 const char *method = value; | |
1396 | |
1397 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom")); | |
1398 } | |
5440 | 1399 #endif |
1400 | |
1401 GtkWidget *sound_page() { | |
1402 GtkWidget *ret; | |
1403 GtkWidget *vbox; | |
1404 GtkSizeGroup *sg; | |
1405 #ifndef _WIN32 | |
1406 GtkWidget *dd; | |
1407 GtkWidget *hbox; | |
1408 GtkWidget *label; | |
6007 | 1409 GtkWidget *entry; |
5684 | 1410 const char *cmd; |
5440 | 1411 #endif |
1412 | |
1413 ret = gtk_vbox_new(FALSE, 18); | |
1414 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1415 | |
1416 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1417 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1418 vbox = gaim_gtk_make_frame (ret, _("Sound Options")); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1419 prefs_checkbox(_("_No sounds when you log in"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1420 "/gaim/gtk/sound/silent_signon", vbox); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1421 prefs_checkbox(_("_Sounds while away"), |
5684 | 1422 "/core/sound/while_away", vbox); |
5440 | 1423 |
1424 #ifndef _WIN32 | |
6033 | 1425 vbox = gaim_gtk_make_frame (ret, _("Sound Method")); |
1426 dd = prefs_dropdown(vbox, _("_Method:"), GAIM_PREF_STRING, | |
5684 | 1427 "/gaim/gtk/sound/method", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1428 _("Console beep"), "beep", |
5440 | 1429 #ifdef USE_AO |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1430 _("Automatic"), "automatic", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1431 "ESD", "esd", |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1432 "Arts", "arts", |
5440 | 1433 #endif |
1434 #ifdef USE_NAS_AUDIO | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1435 "NAS", "nas", |
5440 | 1436 #endif |
5684 | 1437 _("Command"), "custom", |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1438 NULL); |
5440 | 1439 gtk_size_group_add_widget(sg, dd); |
1440 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1441 | |
1442 hbox = gtk_hbox_new(FALSE, 5); | |
1443 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1444 | |
1445 hbox = gtk_hbox_new(FALSE, 5); | |
1446 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
6031 | 1447 label = gtk_label_new_with_mnemonic(_("Sound c_ommand:\n(%s for filename)")); |
5440 | 1448 gtk_size_group_add_widget(sg, label); |
1449 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1450 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1451 | |
6007 | 1452 entry = gtk_entry_new(); |
1453 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); | |
1454 | |
1455 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE); | |
5684 | 1456 cmd = gaim_prefs_get_string("/gaim/gtk/sound/command"); |
5440 | 1457 if(cmd) |
6007 | 1458 gtk_entry_set_text(GTK_ENTRY(entry), cmd); |
1459 gtk_widget_set_size_request(entry, 75, -1); | |
1460 | |
1461 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 5); | |
1462 g_signal_connect(G_OBJECT(entry), "changed", | |
5440 | 1463 G_CALLBACK(sound_cmd_yeah), NULL); |
6005 | 1464 |
1465 gtk_widget_set_sensitive(hbox, | |
1466 !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), | |
1467 "custom")); | |
1468 sound_pref_id = gaim_prefs_connect_callback("/gaim/gtk/sound/method", | |
1469 sound_changed_cb, hbox); | |
1470 | |
5440 | 1471 #endif /* _WIN32 */ |
1472 gtk_widget_show_all(ret); | |
1473 return ret; | |
1474 } | |
1475 | |
1476 GtkWidget *away_page() { | |
1477 GtkWidget *ret; | |
1478 GtkWidget *vbox; | |
1479 GtkWidget *hbox; | |
1480 GtkWidget *label; | |
1481 GtkWidget *button; | |
1482 GtkWidget *select; | |
1483 GtkWidget *dd; | |
1484 GtkSizeGroup *sg; | |
1485 | |
1486 ret = gtk_vbox_new(FALSE, 18); | |
1487 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1488 | |
1489 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
1490 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1491 vbox = gaim_gtk_make_frame (ret, _("Away")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1492 prefs_checkbox(_("_Sending messages removes away status"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1493 "/core/conversations/away_back_on_send", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1494 prefs_checkbox(_("_Queue new messages when away"), |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
1495 "/gaim/gtk/away/queue_messages", vbox); |
5440 | 1496 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1497 vbox = gaim_gtk_make_frame (ret, _("Auto-response")); |
5440 | 1498 hbox = gtk_hbox_new(FALSE, 0); |
1499 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1500 prefs_labeled_spin_button(hbox, _("Seconds before _resending:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1501 "/core/away/auto_response/sec_before_resend", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1502 1, 24 * 60 * 60, sg); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1503 prefs_checkbox(_("_Send auto-response"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1504 "/core/away/auto_response/enabled", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1505 prefs_checkbox(_("_Only send auto-response when idle"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1506 "/core/away/auto_response/idle_only", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1507 prefs_checkbox(_("Send auto-response in active conversations"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1508 "/core/away/auto_response/in_active_conv", vbox); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1509 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1510 if (!gaim_prefs_get_bool("/core/away/auto_response/enabled")) |
5440 | 1511 gtk_widget_set_sensitive(hbox, FALSE); |
1512 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1513 vbox = gaim_gtk_make_frame (ret, _("Idle")); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1514 dd = prefs_dropdown(vbox, _("Idle _time reporting:"), GAIM_PREF_STRING, |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1515 "/gaim/gtk/idle/reporting_method", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1516 _("None"), "none", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1517 _("Gaim usage"), "gaim", |
5440 | 1518 #ifdef USE_SCREENSAVER |
1519 #ifndef _WIN32 | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1520 _("X usage"), "system", |
5440 | 1521 #else |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1522 _("Windows usage"), "system", |
5440 | 1523 #endif |
1524 #endif | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1525 NULL); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1526 |
5440 | 1527 gtk_size_group_add_widget(sg, dd); |
1528 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
1529 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
1530 vbox = gaim_gtk_make_frame (ret, _("Auto-away")); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1531 button = prefs_checkbox(_("Set away _when idle"), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
1532 "/core/away/away_when_idle", vbox); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1533 select = prefs_labeled_spin_button(vbox, _("_Minutes before setting away:"), |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1534 "/core/away/mins_before_away", |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1535 1, 24 * 60, sg); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1536 |
5440 | 1537 g_signal_connect(G_OBJECT(button), "clicked", |
1538 G_CALLBACK(gaim_gtk_toggle_sensitive), select); | |
1539 | |
1540 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); | |
1541 gtk_size_group_add_widget(sg, label); | |
1542 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
1543 hbox = gtk_hbox_new(FALSE, 0); | |
1544 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1545 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1546 prefs_away_menu = gtk_option_menu_new(); | |
1547 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
|
1548 |
5440 | 1549 g_signal_connect(G_OBJECT(button), "clicked", |
1550 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); | |
1551 default_away_menu_init(prefs_away_menu); | |
1552 gtk_widget_show(prefs_away_menu); | |
1553 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
1554 | |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1555 if (!gaim_prefs_get_bool("/core/away/away_when_idle")) { |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1556 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1557 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1558 } |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1559 |
5440 | 1560 gtk_widget_show_all(ret); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
1561 |
5440 | 1562 return ret; |
1563 } | |
1564 | |
1565 static GtkWidget *plugin_description=NULL, *plugin_details=NULL; | |
1566 | |
1567 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) | |
1568 { | |
1569 gchar *buf, *pname, *perr, *pdesc, *pauth, *pweb; | |
1570 GtkTreeIter iter; | |
1571 GValue val = { 0, }; | |
1572 GaimPlugin *plug; | |
1573 | |
1574 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1575 return; | |
1576 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1577 plug = g_value_get_pointer(&val); | |
1578 | |
1579 pname = g_markup_escape_text(_(plug->info->name), -1); | |
1580 pdesc = g_markup_escape_text(_(plug->info->description), -1); | |
1581 pauth = g_markup_escape_text(_(plug->info->author), -1); | |
1582 pweb = g_markup_escape_text(_(plug->info->homepage), -1); | |
1583 if (plug->error != NULL) { | |
1584 perr = g_markup_escape_text(_(plug->error), -1); | |
1585 buf = g_strdup_printf( | |
1586 "<span size=\"larger\">%s %s</span>\n\n" | |
1587 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1588 "%s", | |
1589 pname, plug->info->version, perr, pdesc); | |
1590 g_free(perr); | |
1591 } | |
1592 else { | |
1593 buf = g_strdup_printf( | |
1594 "<span size=\"larger\">%s %s</span>\n\n%s", | |
1595 pname, plug->info->version, pdesc); | |
1596 } | |
1597 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1598 g_free(buf); | |
1599 | |
1600 buf = g_strdup_printf( | |
1601 #ifndef _WIN32 | |
1602 _("<span size=\"larger\">%s %s</span>\n\n" | |
1603 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
1604 "<span weight=\"bold\">Web site:</span>\t\t%s\n" | |
1605 "<span weight=\"bold\">File name:</span>\t%s"), | |
1606 #else | |
1607 _("<span size=\"larger\">%s %s</span>\n\n" | |
1608 "<span weight=\"bold\">Written by:</span> %s\n" | |
1609 "<span weight=\"bold\">URL:</span> %s\n" | |
1610 "<span weight=\"bold\">File name:</span> %s"), | |
1611 #endif | |
1612 pname, plug->info->version, pauth, pweb, plug->path); | |
1613 | |
1614 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); | |
1615 g_value_unset(&val); | |
1616 g_free(buf); | |
1617 g_free(pname); | |
1618 g_free(pdesc); | |
1619 g_free(pauth); | |
1620 g_free(pweb); | |
1621 } | |
1622 | |
1623 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1624 { | |
1625 GtkTreeModel *model = (GtkTreeModel *)data; | |
1626 GtkTreeIter iter; | |
1627 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
1628 GaimPlugin *plug; | |
1629 gchar buf[1024]; | |
6040 | 1630 gchar *name = NULL, *description = NULL; |
5440 | 1631 |
1632 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); | |
1633 gdk_window_set_cursor(prefs->window, wait); | |
1634 gdk_cursor_unref(wait); | |
1635 | |
1636 gtk_tree_model_get_iter (model, &iter, path); | |
1637 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
1638 | |
1639 if (!gaim_plugin_is_loaded(plug)) { | |
1640 gaim_plugin_load(plug); | |
1641 | |
1642 /* | |
1643 * NOTE: This is basically the same check as before | |
1644 * (plug->type == plugin), but now there aren't plugin types. | |
1645 * Not yet, anyway. I want to do a V2 of the plugin API. | |
1646 * The thing is, we should have a flag specifying the UI type, | |
1647 * or just whether it's a general plugin or a UI-specific | |
1648 * plugin. We should only load this if it's UI-specific. | |
1649 * | |
1650 * -- ChipX86 | |
1651 */ | |
1652 if (GAIM_IS_GTK_PLUGIN(plug)) | |
1653 { | |
1654 GtkWidget *config_frame; | |
1655 GaimGtkPluginUiInfo *ui_info; | |
1656 | |
1657 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1658 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
1659 | |
1660 if (config_frame != NULL) { | |
1661 ui_info->iter = g_new0(GtkTreeIter, 1); | |
1662 prefs_notebook_add_page(_(plug->info->name), NULL, | |
1663 config_frame, ui_info->iter, | |
1664 &plugin_iter, notebook_page++); | |
1665 | |
1666 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), | |
1667 &plugin_iter) == 1) { | |
1668 | |
1669 /* Expand the tree for the first plugin added */ | |
1670 GtkTreePath *path2; | |
1671 | |
1672 path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), | |
1673 &plugin_iter); | |
1674 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), | |
1675 path2, TRUE); | |
1676 gtk_tree_path_free(path2); | |
1677 } | |
1678 } | |
1679 } | |
1680 } | |
1681 else { | |
1682 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
1683 GaimGtkPluginUiInfo *ui_info; | |
1684 | |
1685 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
1686 | |
1687 if (ui_info != NULL && ui_info->iter != NULL) { | |
1688 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), ui_info->iter); | |
1689 g_free(ui_info->iter); | |
1690 ui_info->iter = NULL; | |
1691 } | |
1692 } | |
1693 | |
1694 gaim_plugin_unload(plug); | |
1695 } | |
1696 | |
1697 gdk_window_set_cursor(prefs->window, NULL); | |
1698 | |
6040 | 1699 name = g_markup_escape_text(_(plug->info->name), -1); |
1700 description = g_markup_escape_text(_(plug->info->description), -1); | |
5440 | 1701 if (plug->error != NULL) { |
6040 | 1702 gchar *error = g_markup_escape_text(plug->error, -1); |
5440 | 1703 g_snprintf(buf, sizeof(buf), |
1704 "<span size=\"larger\">%s %s</span>\n\n" | |
1705 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" | |
1706 "%s", | |
6040 | 1707 name, plug->info->version, error, description); |
1708 g_free(error); | |
1709 } else { | |
5440 | 1710 g_snprintf(buf, sizeof(buf), |
1711 "<span size=\"larger\">%s %s</span>\n\n%s", | |
6040 | 1712 name, plug->info->version, description); |
5440 | 1713 } |
6040 | 1714 g_free(name); |
1715 g_free(description); | |
5440 | 1716 |
1717 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1718 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, | |
1719 gaim_plugin_is_loaded(plug), -1); | |
1720 | |
1721 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); | |
1722 gtk_tree_path_free(path); | |
5981
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1723 |
81564bb4db68
[gaim-migrate @ 6429]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1724 gaim_gtk_plugins_save(); |
5440 | 1725 } |
1726 | |
1727 static void | |
1728 update_plugin_list(void *data) | |
1729 { | |
1730 GtkListStore *ls = GTK_LIST_STORE(data); | |
1731 GtkTreeIter iter; | |
1732 GList *probes; | |
1733 GaimPlugin *plug; | |
1734 | |
1735 gtk_list_store_clear(ls); | |
1736 | |
1737 for (probes = gaim_plugins_get_all(); | |
1738 probes != NULL; | |
1739 probes = probes->next) { | |
1740 | |
1741 plug = probes->data; | |
1742 | |
1743 if (plug->info->type != GAIM_PLUGIN_STANDARD) | |
1744 continue; | |
1745 | |
1746 gtk_list_store_append (ls, &iter); | |
1747 gtk_list_store_set(ls, &iter, | |
1748 0, gaim_plugin_is_loaded(plug), | |
1749 1, plug->info->name ? _(plug->info->name) : plug->path, | |
1750 2, plug, -1); | |
1751 } | |
1752 } | |
1753 | |
1754 static GtkWidget *plugin_page () | |
1755 { | |
1756 GtkWidget *ret; | |
1757 GtkWidget *sw, *vp; | |
1758 GtkWidget *event_view; | |
1759 GtkListStore *ls; | |
1760 GtkCellRenderer *rend, *rendt; | |
1761 GtkTreeViewColumn *col; | |
1762 GtkTreeSelection *sel; | |
1763 GtkTreePath *path; | |
1764 GtkWidget *nb; | |
1765 | |
1766 ret = gtk_vbox_new(FALSE, 18); | |
1767 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1768 | |
1769 sw = gtk_scrolled_window_new(NULL,NULL); | |
1770 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1771 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1772 | |
1773 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1774 | |
1775 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
1776 | |
1777 update_plugin_list(ls); | |
1778 | |
1779 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); | |
1780 | |
1781 rend = gtk_cell_renderer_toggle_new(); | |
1782 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1783 | |
1784 | |
1785 col = gtk_tree_view_column_new_with_attributes (_("Load"), | |
1786 rend, | |
1787 "active", 0, | |
1788 NULL); | |
1789 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1790 | |
1791 rendt = gtk_cell_renderer_text_new(); | |
1792 col = gtk_tree_view_column_new_with_attributes (_("Name"), | |
1793 rendt, | |
1794 "text", 1, | |
1795 NULL); | |
1796 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1797 g_object_unref(G_OBJECT(ls)); | |
1798 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1799 | |
1800 | |
1801 nb = gtk_notebook_new(); | |
1802 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1803 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1804 | |
1805 /* Description */ | |
1806 sw = gtk_scrolled_window_new(NULL, NULL); | |
1807 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1808 plugin_description = gtk_label_new(NULL); | |
1809 | |
1810 vp = gtk_viewport_new(NULL, NULL); | |
1811 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
1812 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
1813 | |
1814 gtk_container_add(GTK_CONTAINER(vp), plugin_description); | |
1815 gtk_container_add(GTK_CONTAINER(sw), vp); | |
1816 | |
1817 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); | |
1818 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
1819 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); | |
1820 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1821 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1822 | |
1823 /* Details */ | |
1824 sw = gtk_scrolled_window_new(NULL, NULL); | |
1825 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1826 plugin_details = gtk_label_new(NULL); | |
1827 | |
1828 vp = gtk_viewport_new(NULL, NULL); | |
1829 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); | |
1830 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); | |
1831 | |
1832 gtk_container_add(GTK_CONTAINER(vp), plugin_details); | |
1833 gtk_container_add(GTK_CONTAINER(sw), vp); | |
1834 | |
1835 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); | |
1836 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
1837 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); | |
1838 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1839 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1840 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1841 | |
1842 g_signal_connect (G_OBJECT (sel), "changed", | |
1843 G_CALLBACK (prefs_plugin_sel), | |
1844 NULL); | |
1845 g_signal_connect (G_OBJECT(rend), "toggled", | |
1846 G_CALLBACK(plugin_load), ls); | |
1847 | |
1848 path = gtk_tree_path_new_first(); | |
1849 gtk_tree_selection_select_path(sel, path); | |
1850 gtk_tree_path_free(path); | |
1851 | |
1852 gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); | |
1853 | |
1854 gtk_widget_show_all(ret); | |
1855 return ret; | |
1856 } | |
1857 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1858 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1859 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
5440 | 1860 { |
1861 GtkTreeModel *model = (GtkTreeModel *)data; | |
1862 GtkTreeIter iter; | |
1863 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1864 const char *pref; |
5440 | 1865 |
1866 gtk_tree_model_get_iter (model, &iter, path); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1867 gtk_tree_model_get (model, &iter, |
5612 | 1868 2, &pref, |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1869 -1); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1870 |
5684 | 1871 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
|
1872 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1873 gtk_list_store_set(GTK_LIST_STORE (model), &iter, |
5612 | 1874 0, !gtk_cell_renderer_toggle_get_active(cell), |
1875 -1); | |
5440 | 1876 |
1877 gtk_tree_path_free(path); | |
1878 } | |
1879 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1880 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1881 test_sound(GtkWidget *button, gpointer i_am_NULL) |
5440 | 1882 { |
5684 | 1883 char *pref; |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1884 gboolean temp_value1, temp_value2; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1885 |
5684 | 1886 pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", |
1887 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1888 |
5821 | 1889 temp_value1 = gaim_prefs_get_bool("/core/sound/while_away"); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1890 temp_value2 = gaim_prefs_get_bool(pref); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1891 |
5821 | 1892 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
|
1893 if (!temp_value2) gaim_prefs_set_bool(pref, TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1894 |
5440 | 1895 gaim_sound_play_event(sound_row_sel); |
1896 | |
5821 | 1897 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
|
1898 if (!temp_value2) gaim_prefs_set_bool(pref, FALSE); |
5684 | 1899 |
1900 g_free(pref); | |
5440 | 1901 } |
1902 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1903 static void |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
1904 reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
5440 | 1905 { |
5684 | 1906 char *pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
1907 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
1908 | |
5440 | 1909 /* This just resets a sound file back to default */ |
5684 | 1910 gaim_prefs_set_string(pref, ""); |
1911 g_free(pref); | |
5440 | 1912 |
1913 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); | |
1914 } | |
1915 | |
1916 void close_sounddialog(GtkWidget *w, GtkWidget *w2) | |
1917 { | |
1918 | |
1919 GtkWidget *dest; | |
1920 | |
1921 if (!GTK_IS_WIDGET(w2)) | |
1922 dest = w; | |
1923 else | |
1924 dest = w2; | |
1925 | |
1926 sounddialog = NULL; | |
1927 | |
1928 gtk_widget_destroy(dest); | |
1929 } | |
1930 | |
1931 void do_select_sound(GtkWidget *w, int snd) | |
1932 { | |
1933 const char *file; | |
5684 | 1934 char *pref; |
5440 | 1935 |
1936 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); | |
1937 | |
1938 /* If they type in a directory, change there */ | |
5966 | 1939 if (gaim_gtk_check_if_dir(file, GTK_FILE_SELECTION(sounddialog))) |
5440 | 1940 return; |
1941 | |
1942 /* Set it -- and forget it */ | |
5684 | 1943 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
1944 gaim_gtk_sound_get_event_option(snd)); | |
1945 gaim_prefs_set_string(pref, file); | |
1946 g_free(pref); | |
5440 | 1947 |
1948 /* Set our text entry */ | |
1949 gtk_entry_set_text(GTK_ENTRY(sound_entry), file); | |
1950 | |
1951 /* Close the window! It's getting cold in here! */ | |
1952 close_sounddialog(NULL, sounddialog); | |
1953 | |
1954 if (last_sound_dir) | |
1955 g_free(last_sound_dir); | |
1956 last_sound_dir = g_path_get_dirname(file); | |
1957 } | |
1958 | |
1959 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) | |
1960 { | |
1961 char *buf = g_malloc(BUF_LEN); | |
1962 | |
1963 if (!sounddialog) { | |
1964 sounddialog = gtk_file_selection_new(_("Sound Selection")); | |
1965 | |
1966 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1967 | |
1968 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); | |
1969 | |
1970 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1971 | |
1972 g_signal_connect(G_OBJECT(sounddialog), "destroy", | |
1973 G_CALLBACK(close_sounddialog), sounddialog); | |
1974 | |
1975 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), | |
1976 "clicked", | |
1977 G_CALLBACK(do_select_sound), (int *)sound_row_sel); | |
1978 | |
1979 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), | |
1980 "clicked", | |
1981 G_CALLBACK(close_sounddialog), sounddialog); | |
1982 } | |
1983 | |
1984 g_free(buf); | |
1985 gtk_widget_show(sounddialog); | |
1986 gdk_window_raise(sounddialog->window); | |
1987 } | |
1988 | |
1989 | |
1990 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1991 GtkTreeIter iter; | |
1992 GValue val = { 0, }; | |
5684 | 1993 const char *file; |
1994 char *pref; | |
5440 | 1995 |
1996 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1997 return; | |
5612 | 1998 gtk_tree_model_get_value (model, &iter, 3, &val); |
5440 | 1999 sound_row_sel = g_value_get_uint(&val); |
5684 | 2000 |
2001 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", | |
2002 gaim_gtk_sound_get_event_option(sound_row_sel)); | |
2003 file = gaim_prefs_get_string(pref); | |
2004 g_free(pref); | |
5440 | 2005 if (sound_entry) |
6088 | 2006 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); |
5440 | 2007 g_value_unset (&val); |
2008 if (sounddialog) | |
2009 gtk_widget_destroy(sounddialog); | |
2010 } | |
2011 | |
2012 GtkWidget *sound_events_page() { | |
2013 | |
2014 GtkWidget *ret; | |
2015 GtkWidget *sw; | |
2016 GtkWidget *button, *hbox; | |
2017 GtkTreeIter iter; | |
2018 GtkWidget *event_view; | |
2019 GtkListStore *event_store; | |
2020 GtkCellRenderer *rend; | |
2021 GtkTreeViewColumn *col; | |
2022 GtkTreeSelection *sel; | |
2023 GtkTreePath *path; | |
2024 int j; | |
5684 | 2025 const char *file; |
2026 char *pref; | |
5440 | 2027 |
2028 ret = gtk_vbox_new(FALSE, 18); | |
2029 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2030 | |
2031 sw = gtk_scrolled_window_new(NULL,NULL); | |
2032 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
2033 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
2034 | |
2035 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
5612 | 2036 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
5440 | 2037 |
2038 for (j=0; j < GAIM_NUM_SOUNDS; j++) { | |
5684 | 2039 char *pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s", |
2040 gaim_gtk_sound_get_event_option(j)); | |
2041 const char *label = gaim_gtk_sound_get_event_label(j); | |
2042 | |
5870 | 2043 if (label == NULL) { |
2044 g_free(pref); | |
5440 | 2045 continue; |
5870 | 2046 } |
5440 | 2047 |
2048 gtk_list_store_append (event_store, &iter); | |
2049 gtk_list_store_set(event_store, &iter, | |
5612 | 2050 0, gaim_prefs_get_bool(pref), |
5684 | 2051 1, _(label), |
5612 | 2052 2, pref, |
2053 3, j, | |
2054 -1); | |
5684 | 2055 g_free(pref); |
5440 | 2056 } |
2057 | |
2058 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
2059 | |
2060 rend = gtk_cell_renderer_toggle_new(); | |
2061 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
2062 g_signal_connect (G_OBJECT (sel), "changed", | |
2063 G_CALLBACK (prefs_sound_sel), | |
2064 NULL); | |
2065 g_signal_connect (G_OBJECT(rend), "toggled", | |
2066 G_CALLBACK(event_toggled), event_store); | |
2067 path = gtk_tree_path_new_first(); | |
2068 gtk_tree_selection_select_path(sel, path); | |
2069 gtk_tree_path_free(path); | |
2070 | |
2071 col = gtk_tree_view_column_new_with_attributes (_("Play"), | |
2072 rend, | |
2073 "active", 0, | |
2074 NULL); | |
2075 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2076 | |
2077 rend = gtk_cell_renderer_text_new(); | |
2078 col = gtk_tree_view_column_new_with_attributes (_("Event"), | |
2079 rend, | |
2080 "text", 1, | |
2081 NULL); | |
2082 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2083 g_object_unref(G_OBJECT(event_store)); | |
2084 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
2085 | |
2086 hbox = gtk_hbox_new(FALSE, 6); | |
2087 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
2088 sound_entry = gtk_entry_new(); | |
5684 | 2089 pref = g_strdup_printf("/gaim/gtk/sound/file/%s", |
2090 gaim_gtk_sound_get_event_option(0)); | |
2091 file = gaim_prefs_get_string(pref); | |
2092 g_free(pref); | |
6088 | 2093 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)"); |
5440 | 2094 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
2095 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); | |
2096 | |
2097 button = gtk_button_new_with_label(_("Test")); | |
2098 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); | |
2099 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
2100 | |
2101 button = gtk_button_new_with_label(_("Reset")); | |
2102 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); | |
2103 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
2104 | |
2105 button = gtk_button_new_with_label(_("Choose...")); | |
2106 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); | |
2107 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); | |
2108 | |
2109 gtk_widget_show_all (ret); | |
2110 | |
2111 return ret; | |
2112 } | |
2113 | |
2114 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) | |
2115 { | |
2116 GtkTreeIter iter; | |
2117 GValue val = { 0, }; | |
2118 gchar buffer[BUF_LONG]; | |
2119 char *tmp; | |
2120 struct away_message *am; | |
2121 | |
2122 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
2123 return; | |
2124 gtk_tree_model_get_value (model, &iter, 1, &val); | |
2125 am = g_value_get_pointer(&val); | |
2126 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
2127 strncpy(buffer, am->message, BUF_LONG); | |
2128 tmp = stylize(buffer, BUF_LONG); | |
2129 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | | |
2130 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
2131 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | | |
2132 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); | |
2133 g_free(tmp); | |
2134 g_value_unset (&val); | |
2135 | |
2136 } | |
2137 | |
2138 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { | |
6016 | 2139 struct away_message *am; |
5440 | 2140 GtkTreeIter iter; |
2141 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
2142 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); | |
2143 GValue val = { 0, }; | |
2144 | |
2145 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
2146 return; | |
2147 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); | |
2148 am = g_value_get_pointer (&val); | |
2149 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
2150 rem_away_mess(NULL, am); | |
2151 } | |
2152 | |
2153 GtkWidget *away_message_page() { | |
2154 GtkWidget *ret; | |
2155 GtkWidget *hbox; | |
2156 GtkWidget *button; | |
2157 GtkWidget *sw; | |
2158 GtkTreeIter iter; | |
2159 GtkWidget *event_view; | |
2160 GtkCellRenderer *rend; | |
2161 GtkTreeViewColumn *col; | |
2162 GtkTreeSelection *sel; | |
2163 GSList *awy = away_messages; | |
2164 struct away_message *a; | |
2165 GtkWidget *sw2; | |
2166 GtkSizeGroup *sg; | |
2167 | |
2168 ret = gtk_vbox_new(FALSE, 18); | |
2169 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2170 | |
2171 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
2172 | |
2173 sw = gtk_scrolled_window_new(NULL,NULL); | |
2174 away_text = gtk_imhtml_new(NULL, NULL); | |
2175 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
2176 /* | |
2177 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
2178 */ | |
2179 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
2180 | |
2181 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); | |
2182 while (awy) { | |
2183 a = (struct away_message *)awy->data; | |
2184 gtk_list_store_append (prefs_away_store, &iter); | |
2185 gtk_list_store_set(prefs_away_store, &iter, | |
2186 0, a->name, | |
2187 1, a, -1); | |
2188 awy = awy->next; | |
2189 } | |
2190 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
2191 | |
2192 | |
2193 rend = gtk_cell_renderer_text_new(); | |
2194 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
2195 rend, | |
2196 "text", 0, | |
2197 NULL); | |
2198 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
2199 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
2200 gtk_widget_show(event_view); | |
2201 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); | |
2202 | |
2203 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
2204 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
2205 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
2206 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); | |
2207 | |
2208 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); | |
2209 gaim_setup_imhtml(away_text); | |
2210 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
2211 g_signal_connect (G_OBJECT (sel), "changed", | |
2212 G_CALLBACK (away_message_sel), | |
2213 NULL); | |
2214 hbox = gtk_hbox_new(TRUE, 5); | |
2215 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
2216 button = gtk_button_new_from_stock (GTK_STOCK_ADD); | |
2217 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2218 gtk_size_group_add_widget(sg, button); | |
2219 g_signal_connect(G_OBJECT(button), "clicked", | |
2220 G_CALLBACK(create_away_mess), NULL); | |
2221 | |
2222 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); | |
2223 gtk_size_group_add_widget(sg, button); | |
2224 g_signal_connect(G_OBJECT(button), "clicked", | |
2225 G_CALLBACK(remove_away_message), event_view); | |
2226 | |
2227 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2228 | |
2229 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); | |
2230 gtk_size_group_add_widget(sg, button); | |
2231 g_signal_connect(G_OBJECT(button), "clicked", | |
2232 G_CALLBACK(create_away_mess), event_view); | |
2233 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2234 | |
2235 gtk_widget_show_all(ret); | |
2236 return ret; | |
2237 } | |
2238 | |
2239 GtkTreeIter *prefs_notebook_add_page(const char *text, | |
2240 GdkPixbuf *pixbuf, | |
2241 GtkWidget *page, | |
2242 GtkTreeIter *iter, | |
2243 GtkTreeIter *parent, | |
2244 int ind) { | |
2245 GdkPixbuf *icon = NULL; | |
2246 | |
2247 if (pixbuf) | |
2248 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); | |
2249 | |
2250 gtk_tree_store_append (prefstree, iter, parent); | |
2251 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
2252 | |
2253 if (pixbuf) | |
2254 g_object_unref(pixbuf); | |
2255 if (icon) | |
2256 g_object_unref(icon); | |
2257 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
2258 return iter; | |
2259 } | |
2260 | |
2261 void prefs_notebook_init() { | |
2262 GtkTreeIter p, p2, c; | |
2263 GList *l; | |
2264 GaimPlugin *plug; | |
2265 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); | |
2266 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); | |
2267 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); | |
2268 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
2269 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
2270 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
2271 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); | |
2272 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); | |
2273 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); | |
2274 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); | |
2275 #ifndef _WIN32 | |
2276 /* We use the registered default browser in windows */ | |
2277 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | |
2278 #endif | |
2279 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); | |
2280 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
2281 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
2282 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
2283 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
2284 | |
2285 if (gaim_plugins_enabled()) { | |
2286 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); | |
2287 | |
2288 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { | |
2289 plug = l->data; | |
2290 | |
2291 if (GAIM_IS_GTK_PLUGIN(plug)) { | |
2292 GtkWidget *config_frame; | |
2293 GaimGtkPluginUiInfo *ui_info; | |
2294 | |
2295 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); | |
2296 config_frame = gaim_gtk_plugin_get_config_frame(plug); | |
2297 | |
2298 if (config_frame != NULL) { | |
2299 ui_info->iter = g_new0(GtkTreeIter, 1); | |
2300 prefs_notebook_add_page(_(plug->info->name), NULL, | |
2301 config_frame, ui_info->iter, | |
2302 &plugin_iter, notebook_page++); | |
2303 } | |
2304 } | |
2305 } | |
2306 } | |
2307 } | |
2308 | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2309 void gaim_gtk_prefs_show(void) |
5440 | 2310 { |
2311 GtkWidget *vbox, *vbox2; | |
2312 GtkWidget *hbox; | |
2313 GtkWidget *frame; | |
2314 GtkTreeViewColumn *column; | |
2315 GtkCellRenderer *cell; | |
2316 GtkTreeSelection *sel; | |
2317 GtkWidget *notebook; | |
2318 GtkWidget *sep; | |
2319 GtkWidget *button; | |
2320 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
2321 | |
2322 if (prefs) { | |
2323 gtk_window_present(GTK_WINDOW(prefs)); | |
2324 return; | |
2325 } | |
2326 | |
2327 /* copy the preferences to tmp values... | |
2328 * I liked "take affect immediately" Oh well :-( */ | |
6016 | 2329 /* (that should have been "effect," right?) */ |
2330 | |
5440 | 2331 /* Back to instant-apply! I win! BU-HAHAHA! */ |
2332 | |
2333 /* Create the window */ | |
2334 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
2335 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); | |
2336 gtk_widget_realize(prefs); | |
2337 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); | |
2338 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); | |
2339 g_signal_connect(G_OBJECT(prefs), "destroy", | |
2340 G_CALLBACK(delete_prefs), NULL); | |
2341 | |
2342 vbox = gtk_vbox_new(FALSE, 5); | |
2343 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | |
2344 gtk_container_add(GTK_CONTAINER(prefs), vbox); | |
2345 gtk_widget_show(vbox); | |
2346 | |
2347 hbox = gtk_hbox_new (FALSE, 6); | |
2348 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
2349 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
2350 gtk_widget_show (hbox); | |
2351 | |
2352 frame = gtk_frame_new (NULL); | |
2353 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
2354 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
2355 gtk_widget_show (frame); | |
2356 | |
2357 /* The tree -- much inspired by the Gimp */ | |
2358 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
2359 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
2360 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
2361 | |
2362 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
2363 gtk_widget_show(tree_v); | |
2364 /* icons */ | |
2365 /* XXX: to be used at a later date | |
2366 cell = gtk_cell_renderer_pixbuf_new (); | |
2367 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
2368 */ | |
2369 | |
2370 /* text */ | |
2371 cell = gtk_cell_renderer_text_new (); | |
2372 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
2373 | |
2374 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); | |
2375 | |
2376 /* The right side */ | |
2377 frame = gtk_frame_new (NULL); | |
2378 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
2379 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
2380 gtk_widget_show (frame); | |
2381 | |
2382 vbox2 = gtk_vbox_new (FALSE, 4); | |
2383 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
2384 gtk_widget_show (vbox2); | |
2385 | |
2386 frame = gtk_frame_new (NULL); | |
2387 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
2388 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
2389 gtk_widget_show (frame); | |
2390 | |
2391 hbox = gtk_hbox_new (FALSE, 4); | |
2392 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
2393 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
2394 gtk_widget_show (hbox); | |
2395 | |
2396 preflabel = gtk_label_new(NULL); | |
2397 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
2398 gtk_widget_show (preflabel); | |
2399 | |
2400 /* The notebook */ | |
2401 prefsnotebook = notebook = gtk_notebook_new (); | |
2402 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
2403 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
2404 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
2405 | |
2406 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); | |
2407 g_signal_connect (G_OBJECT (sel), "changed", | |
2408 G_CALLBACK (pref_nb_select), | |
2409 notebook); | |
2410 gtk_widget_show(notebook); | |
2411 sep = gtk_hseparator_new(); | |
2412 gtk_widget_show(sep); | |
2413 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
2414 | |
2415 /* The buttons^H to press! */ | |
2416 hbox = gtk_hbox_new (FALSE, 6); | |
2417 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
2418 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
2419 gtk_widget_show (hbox); | |
2420 | |
2421 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); | |
2422 gtk_size_group_add_widget(sg, button); | |
2423 g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
2424 G_CALLBACK(gtk_widget_destroy), prefs); | |
2425 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
2426 gtk_widget_show(button); | |
2427 | |
2428 prefs_notebook_init(); | |
2429 | |
5568
fb4f7bd7525c
[gaim-migrate @ 5970]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2430 /* Show everything. */ |
5440 | 2431 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
2432 gtk_widget_show(prefs); | |
2433 } | |
2434 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2435 #if 0 |
5440 | 2436 static void set_logging_option(GtkWidget *w, int option) |
2437 { | |
2438 logging_options ^= option; | |
2439 | |
2440 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) | |
2441 update_log_convs(); | |
2442 } | |
2443 | |
2444 static void set_convo_option(GtkWidget *w, int option) | |
2445 { | |
2446 convo_options ^= option; | |
2447 | |
2448 if (option == OPT_CONVO_SHOW_SMILEY) | |
2449 gaim_gtkconv_toggle_smileys(); | |
2450 | |
2451 if (option == OPT_CONVO_SHOW_TIME) | |
2452 gaim_gtkconv_toggle_timestamps(); | |
2453 } | |
2454 | |
2455 static void set_im_option(GtkWidget *w, int option) | |
2456 { | |
2457 im_options ^= option; | |
2458 | |
2459 #if 0 | |
2460 if (option == OPT_IM_ONE_WINDOW) | |
2461 im_tabize(); | |
2462 #endif | |
2463 } | |
2464 | |
2465 static void set_chat_option(GtkWidget *w, int option) | |
2466 { | |
2467 chat_options ^= option; | |
2468 | |
2469 #if 0 | |
2470 if (option == OPT_CHAT_ONE_WINDOW) | |
2471 chat_tabize(); | |
2472 #endif | |
2473 } | |
2474 | |
2475 static void set_away_option(GtkWidget *w, int option) | |
2476 { | |
2477 away_options ^= option; | |
2478 | |
2479 if (option == OPT_AWAY_QUEUE) | |
2480 toggle_away_queue(); | |
2481 } | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2482 #endif |
5440 | 2483 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2484 static void |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2485 set_bool_pref(GtkWidget *w, const char *key) |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2486 { |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2487 gaim_prefs_set_bool(key, |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2488 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2489 } |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2490 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2491 static GtkWidget * |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2492 prefs_checkbox(const char *text, const char *key, GtkWidget *page) |
5440 | 2493 { |
2494 GtkWidget *button; | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2495 |
5440 | 2496 button = gtk_check_button_new_with_mnemonic(text); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2497 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2498 gaim_prefs_get_bool(key)); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2499 |
5440 | 2500 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
|
2501 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2502 g_signal_connect(G_OBJECT(button), "clicked", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2503 G_CALLBACK(set_bool_pref), (char *)key); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2504 |
5440 | 2505 gtk_widget_show(button); |
2506 | |
2507 return button; | |
2508 } | |
2509 | |
2510 void default_away_menu_init(GtkWidget *omenu) | |
2511 { | |
2512 GtkWidget *menu, *opt; | |
2513 int index = 0; | |
2514 GSList *awy = away_messages; | |
2515 struct away_message *a; | |
2516 | |
2517 menu = gtk_menu_new(); | |
2518 | |
2519 while (awy) { | |
2520 a = (struct away_message *)awy->data; | |
2521 opt = gtk_menu_item_new_with_label(a->name); | |
2522 g_signal_connect(G_OBJECT(opt), "activate", | |
2523 G_CALLBACK(set_default_away), (gpointer)index); | |
2524 gtk_widget_show(opt); | |
2525 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
2526 | |
2527 awy = awy->next; | |
2528 index++; | |
2529 } | |
2530 | |
2531 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2532 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
2533 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
2534 } | |
2535 | |
2536 GtkWidget *pref_fg_picture = NULL; | |
2537 GtkWidget *pref_bg_picture = NULL; | |
2538 | |
2539 void destroy_colorsel(GtkWidget *w, gpointer d) | |
2540 { | |
2541 if (d) { | |
2542 gtk_widget_destroy(fgcseld); | |
2543 fgcseld = NULL; | |
2544 } else { | |
2545 gtk_widget_destroy(bgcseld); | |
2546 bgcseld = NULL; | |
2547 } | |
2548 } | |
2549 | |
2550 void apply_color_dlg(GtkWidget *w, gpointer d) | |
2551 { | |
5671 | 2552 char buf[14]; |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2553 |
5440 | 2554 if ((int)d == 1) { |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2555 GdkColor fgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2556 |
5440 | 2557 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION |
2558 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), | |
2559 &fgcolor); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2560 |
5671 | 2561 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2562 fgcolor.red, fgcolor.green, fgcolor.blue); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2563 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2564 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", buf); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2565 |
5440 | 2566 destroy_colorsel(NULL, (void *)1); |
2567 update_color(NULL, pref_fg_picture); | |
2568 } else { | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2569 GdkColor bgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2570 |
5440 | 2571 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION |
2572 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), | |
2573 &bgcolor); | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2574 |
5671 | 2575 g_snprintf(buf, sizeof(buf), "#%04x%04x%04x", |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2576 bgcolor.red, bgcolor.green, bgcolor.blue); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2577 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2578 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", buf); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2579 |
5440 | 2580 destroy_colorsel(NULL, (void *)0); |
2581 update_color(NULL, pref_bg_picture); | |
2582 } | |
2583 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); | |
2584 } | |
2585 | |
2586 void set_default_away(GtkWidget *w, gpointer i) | |
2587 { | |
2588 | |
2589 int length = g_slist_length(away_messages); | |
2590 | |
2591 if (away_messages == NULL) | |
2592 default_away = NULL; | |
2593 else if ((int)i >= length) | |
2594 default_away = g_slist_nth_data(away_messages, length - 1); | |
2595 else | |
2596 default_away = g_slist_nth_data(away_messages, (int)i); | |
2597 } | |
2598 | |
2599 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) | |
2600 { | |
2601 /* more stuff stolen from X-Chat */ | |
2602 GtkWidget *swid; | |
2603 GdkColor c; | |
2604 GtkStyle *style; | |
2605 c.pixel = 0; | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2606 |
5440 | 2607 if (fgc) { |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2608 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
|
2609 GdkColor fgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2610 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2611 gdk_color_parse( |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2612 gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2613 &fgcolor); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2614 |
5440 | 2615 c.red = fgcolor.red; |
2616 c.blue = fgcolor.blue; | |
2617 c.green = fgcolor.green; | |
2618 } else { | |
2619 c.red = 0; | |
2620 c.blue = 0; | |
2621 c.green = 0; | |
2622 } | |
2623 } else { | |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2624 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
|
2625 GdkColor bgcolor; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2626 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2627 gdk_color_parse( |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2628 gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2629 &bgcolor); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2630 |
5440 | 2631 c.red = bgcolor.red; |
2632 c.blue = bgcolor.blue; | |
2633 c.green = bgcolor.green; | |
2634 } else { | |
2635 c.red = 0xffff; | |
2636 c.blue = 0xffff; | |
2637 c.green = 0xffff; | |
2638 } | |
2639 } | |
2640 | |
2641 style = gtk_style_new(); | |
2642 style->bg[0] = c; | |
2643 | |
2644 swid = gtk_event_box_new(); | |
2645 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
2646 g_object_unref(style); | |
2647 gtk_widget_set_size_request(GTK_WIDGET(swid), 40, -1); | |
2648 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); | |
2649 gtk_widget_show(swid); | |
2650 return swid; | |
2651 } | |
2652 | |
2653 void apply_font_dlg(GtkWidget *w, GtkWidget *f) | |
2654 { | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2655 char *fontname, *c; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2656 |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2657 fontname = |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2658 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
|
2659 |
5440 | 2660 destroy_fontsel(0, 0); |
2661 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2662 for (c = fontname; *c != '\0'; c++) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2663 if (isdigit(*c)) { |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2664 *(--c) = '\0'; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2665 break; |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2666 } |
5440 | 2667 } |
2668 | |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2669 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", fontname); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2670 |
5440 | 2671 g_free(fontname); |
2672 | |
2673 gaim_conversation_foreach(gaim_gtkconv_update_font_face); | |
2674 } | |
2675 | |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2676 static void |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2677 smiley_theme_pref_cb(const char *name, GaimPrefType type, gpointer value, |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2678 gpointer data) |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2679 { |
5841 | 2680 if (!strcmp(name, "/gaim/gtk/smileys/theme")) |
5771
f63a008726c6
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2681 load_smiley_theme((const char *)value, TRUE); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2682 } |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2683 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2684 void |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2685 gaim_gtk_prefs_init(void) |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2686 { |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2687 gaim_prefs_add_none("/gaim"); |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2688 gaim_prefs_add_none("/gaim/gtk"); |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2689 gaim_prefs_add_none("/plugins/gtk"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2690 |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2691 /* XXX Move this! HACK! :( Aww... */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2692 gaim_prefs_add_none("/plugins/gtk/docklet"); |
5554
7b36d02031a2
[gaim-migrate @ 5955]
Christian Hammond <chipx86@chipx86.com>
parents:
5551
diff
changeset
|
2693 gaim_prefs_add_bool("/plugins/gtk/docklet/queue_messages", FALSE); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2694 |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2695 /* Accounts Dialog */ |
5567
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2696 gaim_prefs_add_none("/gaim/gtk/accounts"); |
cc9ddec20010
[gaim-migrate @ 5969]
Christian Hammond <chipx86@chipx86.com>
parents:
5563
diff
changeset
|
2697 gaim_prefs_add_none("/gaim/gtk/accounts/dialog"); |
5563
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2698 gaim_prefs_add_int("/gaim/gtk/accounts/dialog/width", 550); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2699 gaim_prefs_add_int("/gaim/gtk/accounts/dialog/height", 250); |
9eb5b13fd412
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5560
diff
changeset
|
2700 |
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2701 /* Away Queueing */ |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2702 gaim_prefs_add_none("/gaim/gtk/away"); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2703 gaim_prefs_add_bool("/gaim/gtk/away/queue_messages", FALSE); |
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5568
diff
changeset
|
2704 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2705 /* Browsers */ |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2706 gaim_prefs_add_none("/gaim/gtk/browsers"); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2707 gaim_prefs_add_bool("/gaim/gtk/browsers/new_window", FALSE); |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2708 gaim_prefs_add_string("/gaim/gtk/browsers/command", ""); |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2709 gaim_prefs_add_string("/gaim/gtk/browsers/browser", "mozilla"); |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2710 |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2711 /* Buddy List */ |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2712 gaim_prefs_add_none("/gaim/gtk/blist"); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2713 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
|
2714 gaim_prefs_add_bool("/gaim/gtk/blist/grey_idle_buddies", TRUE); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2715 gaim_prefs_add_bool("/gaim/gtk/blist/raise_on_events", FALSE); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2716 gaim_prefs_add_bool("/gaim/gtk/blist/show_buddy_icons", TRUE); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2717 gaim_prefs_add_bool("/gaim/gtk/blist/show_empty_groups", FALSE); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2718 gaim_prefs_add_bool("/gaim/gtk/blist/show_group_count", TRUE); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2719 gaim_prefs_add_bool("/gaim/gtk/blist/show_idle_time", TRUE); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2720 gaim_prefs_add_bool("/gaim/gtk/blist/show_offline_buddies", FALSE); |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2721 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
|
2722 gaim_prefs_add_string("/gaim/gtk/blist/sort_type", ""); |
5560
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2723 gaim_prefs_add_int("/gaim/gtk/blist/x", 0); |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2724 gaim_prefs_add_int("/gaim/gtk/blist/y", 0); |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2725 gaim_prefs_add_int("/gaim/gtk/blist/width", 0); |
b7319c094153
[gaim-migrate @ 5961]
Christian Hammond <chipx86@chipx86.com>
parents:
5554
diff
changeset
|
2726 gaim_prefs_add_int("/gaim/gtk/blist/height", 0); |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2727 |
5550
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2728 /* Idle */ |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2729 gaim_prefs_add_none("/gaim/gtk/idle"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2730 gaim_prefs_add_string("/gaim/gtk/idle/reporting_method", "system"); |
b18c2a37cc96
[gaim-migrate @ 5951]
Christian Hammond <chipx86@chipx86.com>
parents:
5547
diff
changeset
|
2731 |
5545
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2732 /* Logging */ |
7a64114641c3
[gaim-migrate @ 5946]
Christian Hammond <chipx86@chipx86.com>
parents:
5539
diff
changeset
|
2733 gaim_prefs_add_none("/gaim/gtk/logging"); |
5551
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2734 gaim_prefs_add_bool("/gaim/gtk/logging/log_ims", TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2735 gaim_prefs_add_bool("/gaim/gtk/logging/log_chats", TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2736 gaim_prefs_add_bool("/gaim/gtk/logging/strip_html", TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2737 gaim_prefs_add_bool("/gaim/gtk/logging/log_signon_signoff", TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2738 gaim_prefs_add_bool("/gaim/gtk/logging/log_idle_state", TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2739 gaim_prefs_add_bool("/gaim/gtk/logging/log_away_state", TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2740 gaim_prefs_add_bool("/gaim/gtk/logging/log_own_states", TRUE); |
51699de873af
[gaim-migrate @ 5952]
Christian Hammond <chipx86@chipx86.com>
parents:
5550
diff
changeset
|
2741 gaim_prefs_add_bool("/gaim/gtk/logging/individual_logs", FALSE); |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2742 |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2743 /* Plugins */ |
5982
35d3c1ac5ece
[gaim-migrate @ 6430]
Christian Hammond <chipx86@chipx86.com>
parents:
5981
diff
changeset
|
2744 gaim_prefs_add_none("/gaim/gtk/plugins"); |
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2745 gaim_prefs_add_string_list("/gaim/gtk/plugins/loaded", NULL); |
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
2746 |
5539
de09863bd4b5
[gaim-migrate @ 5939]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
2747 /* Smiley Themes */ |
5546
22cf337e8b8f
[gaim-migrate @ 5947]
Christian Hammond <chipx86@chipx86.com>
parents:
5545
diff
changeset
|
2748 gaim_prefs_add_none("/gaim/gtk/smileys"); |
5771
f63a008726c6
[gaim-migrate @ 6196]
Christian Hammond <chipx86@chipx86.com>
parents:
5770
diff
changeset
|
2749 gaim_prefs_add_string("/gaim/gtk/smileys/theme", ""); |
5770
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2750 |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2751 /* Smiley Callbacks */ |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2752 gaim_prefs_connect_callback("/gaim/gtk/smileys/theme", |
a86051df9122
[gaim-migrate @ 6195]
Christian Hammond <chipx86@chipx86.com>
parents:
5753
diff
changeset
|
2753 smiley_theme_pref_cb, NULL); |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2754 } |
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5440
diff
changeset
|
2755 |