Mercurial > pidgin
annotate src/prefs.c @ 5297:d4c9c5491812
[gaim-migrate @ 5669]
Deryni turned off the 30 sec timer when idle times aren't being displayed
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 05 May 2003 20:38:49 +0000 |
parents | 72f102ca9982 |
children | 1f901484599d |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
3434 | 4 * Copyright (C) 1998-2002, Mark Spencer <markster@marko.net> |
1 | 5 * |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2074
diff
changeset
|
23 #include <config.h> |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
340
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 | |
28 #include <sys/types.h> | |
29 #include <sys/stat.h> | |
30 | |
31 #include <unistd.h> | |
32 #include <stdio.h> | |
33 #include <stdlib.h> | |
970 | 34 #include <stdarg.h> |
3379 | 35 #include <ctype.h> |
1 | 36 #include <gtk/gtk.h> |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
37 #include "gtkimhtml.h" |
1 | 38 #include "gaim.h" |
5228
1a53330dfd34
[gaim-migrate @ 5598]
Christian Hammond <chipx86@chipx86.com>
parents:
5211
diff
changeset
|
39 #include "gtkblist.h" |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
40 #include "gtkplugin.h" |
1357
783ba886b6b6
[gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1324
diff
changeset
|
41 #include "prpl.h" |
3366 | 42 #include "proxy.h" |
4561 | 43 #include "sound.h" |
3366 | 44 |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
45 #ifdef _WIN32 |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
46 #include "win32dep.h" |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
47 #endif |
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
48 |
3567 | 49 GtkWidget *tree_v = NULL; |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
50 GtkWidget *prefs_away_menu = NULL; |
3366 | 51 GtkWidget *fontseld = NULL; |
52 | |
3379 | 53 GtkListStore *prefs_away_store = NULL; |
3366 | 54 |
55 static int sound_row_sel = 0; | |
56 static char *last_sound_dir = NULL; | |
57 | |
58 static GtkWidget *sounddialog = NULL; | |
59 static GtkWidget *browser_entry = NULL; | |
60 static GtkWidget *sound_entry = NULL; | |
61 static GtkWidget *away_text = NULL; | |
4324 | 62 static GtkListStore *smiley_theme_store = NULL; |
2254 | 63 GtkWidget *prefs_proxy_frame = NULL; |
4026
a997156437b6
[gaim-migrate @ 4230]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4010
diff
changeset
|
64 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); |
3427 | 65 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); |
3366 | 66 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); |
4428 | 67 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *); |
3366 | 68 static GtkWidget *show_color_pref(GtkWidget *, gboolean); |
69 static void delete_prefs(GtkWidget *, void *); | |
70 void set_default_away(GtkWidget *, gpointer); | |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
71 #ifndef _WIN32 |
4428 | 72 static gboolean program_is_valid(const char *); |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
73 #endif |
1026 | 74 |
3565 | 75 GtkWidget *prefs = NULL; |
3366 | 76 GtkWidget *debugbutton = NULL; |
3565 | 77 static int notebook_page = 0; |
78 static GtkTreeIter plugin_iter; | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
79 |
3630 | 80 /* |
81 * PROTOTYPES | |
82 */ | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
83 GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
84 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
85 static void update_plugin_list(void *data); |
3630 | 86 |
3366 | 87 void delete_prefs(GtkWidget *asdf, void *gdsa) { |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
88 GList *l; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
89 GaimPlugin *plug; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
90 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
91 gaim_plugins_unregister_probe_notify_cb(update_plugin_list); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
92 |
4064 | 93 save_prefs(); |
3485 | 94 prefs = NULL; |
3567 | 95 tree_v = NULL; |
3485 | 96 sound_entry = NULL; |
97 browser_entry = NULL; | |
3526 | 98 debugbutton = NULL; |
99 prefs_away_menu = NULL; | |
3565 | 100 notebook_page = 0; |
4324 | 101 smiley_theme_store = NULL; |
3485 | 102 if(sounddialog) |
3379 | 103 gtk_widget_destroy(sounddialog); |
3500 | 104 g_object_unref(G_OBJECT(prefs_away_store)); |
4635 | 105 prefs_away_store = NULL; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
106 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
107 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { |
4215 | 108 plug = l->data; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
109 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
110 if (GAIM_IS_GTK_PLUGIN(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
111 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
112 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
113 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
114 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
115 if (ui_info->iter != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
116 g_free(ui_info->iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
117 ui_info->iter = NULL; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
118 } |
4215 | 119 } |
120 } | |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
121 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
122 |
3366 | 123 GtkWidget *preflabel; |
124 GtkWidget *prefsnotebook; | |
125 GtkTreeStore *prefstree; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
126 |
3818 | 127 static void set_misc_option(); |
128 static void set_logging_option(); | |
129 static void set_blist_option(); | |
130 static void set_convo_option(); | |
131 static void set_im_option(); | |
132 static void set_chat_option(); | |
133 static void set_font_option(); | |
134 static void set_sound_option(); | |
135 static void set_away_option(); | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
136 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
137 #define PROXYHOST 0 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
138 #define PROXYPORT 1 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
139 #define PROXYTYPE 2 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
140 #define PROXYUSER 3 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
141 #define PROXYPASS 4 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
142 static void proxy_print_option(GtkEntry *entry, int entrynum) |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
143 { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
144 if (entrynum == PROXYHOST) |
4634 | 145 g_snprintf(global_proxy_info.proxyhost, sizeof(global_proxy_info.proxyhost), "%s", gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
146 else if (entrynum == PROXYPORT) |
4634 | 147 global_proxy_info.proxyport = atoi(gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
148 else if (entrynum == PROXYUSER) |
4634 | 149 g_snprintf(global_proxy_info.proxyuser, sizeof(global_proxy_info.proxyuser), "%s", gtk_entry_get_text(entry)); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
150 else if (entrynum == PROXYPASS) |
4634 | 151 g_snprintf(global_proxy_info.proxypass, sizeof(global_proxy_info.proxypass), "%s", gtk_entry_get_text(entry)); |
4137 | 152 proxy_info_is_from_gaimrc = 1; /* If the user specifies it, we want |
153 to save it */ | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
154 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
155 |
3366 | 156 |
3565 | 157 GtkWidget *make_frame(GtkWidget *ret, char *text) { |
3427 | 158 GtkWidget *vbox, *label, *hbox; |
159 char labeltext[256]; | |
3500 | 160 |
3427 | 161 vbox = gtk_vbox_new(FALSE, 6); |
162 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0); | |
163 label = gtk_label_new(NULL); | |
164 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text); | |
165 gtk_label_set_markup(GTK_LABEL(label), labeltext); | |
166 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
167 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
168 hbox = gtk_hbox_new(FALSE, 6); | |
169 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); | |
170 label = gtk_label_new(" "); | |
171 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
172 vbox = gtk_vbox_new(FALSE, 6); | |
173 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); | |
174 return vbox; | |
175 } | |
176 | |
3366 | 177 /* OK, Apply and Cancel */ |
178 | |
179 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) { | |
180 GtkTreeIter iter; | |
3427 | 181 char text[128]; |
3366 | 182 GValue val = { 0, }; |
183 GtkTreeModel *model = GTK_TREE_MODEL(prefstree); | |
3500 | 184 |
3366 | 185 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
186 return; | |
187 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3500 | 188 g_snprintf(text, sizeof(text), "<span weight=\"bold\" size=\"larger\">%s</span>", |
3427 | 189 g_value_get_string(&val)); |
190 gtk_label_set_markup (GTK_LABEL(preflabel), text); | |
3366 | 191 g_value_unset (&val); |
192 gtk_tree_model_get_value (model, &iter, 2, &val); | |
193 gtk_notebook_set_current_page (GTK_NOTEBOOK (prefsnotebook), g_value_get_int (&val)); | |
194 | |
195 } | |
196 | |
197 /* These are the pages in the preferences notebook */ | |
198 GtkWidget *interface_page() { | |
199 GtkWidget *ret; | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
200 GtkWidget *vbox; |
3427 | 201 ret = gtk_vbox_new(FALSE, 18); |
202 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 203 |
3427 | 204 vbox = make_frame(ret, _("Interface Options")); |
3500 | 205 |
4227 | 206 gaim_button(_("D_isplay remote nicknames if no alias is set"), &misc_options, OPT_MISC_USE_SERVER_ALIAS, vbox); |
207 | |
3366 | 208 |
3427 | 209 gtk_widget_show_all(ret); |
3366 | 210 return ret; |
211 } | |
212 | |
4288 | 213 static void smiley_sel (GtkTreeSelection *sel, GtkTreeModel *model) { |
214 GtkTreeIter iter; | |
4298 | 215 const char *filename; |
4288 | 216 GValue val = { 0, }; |
217 | |
218 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
219 return; | |
220 gtk_tree_model_get_value (model, &iter, 2, &val); | |
221 filename = g_value_get_string(&val); | |
222 load_smiley_theme(filename, TRUE); | |
223 g_value_unset (&val); | |
4302 | 224 save_prefs(); |
4288 | 225 } |
226 | |
4324 | 227 GtkTreePath *theme_refresh_theme_list() |
228 { | |
229 GdkPixbuf *pixbuf; | |
4323 | 230 GSList *themes; |
4288 | 231 GtkTreeIter iter; |
4328 | 232 GtkTreePath *path = NULL; |
4325 | 233 int ind = 0; |
234 | |
4288 | 235 |
4323 | 236 smiley_theme_probe(); |
4328 | 237 |
4323 | 238 if (!smiley_themes) |
4328 | 239 return NULL; |
4325 | 240 |
4323 | 241 themes = smiley_themes; |
4325 | 242 |
243 gtk_list_store_clear(smiley_theme_store); | |
244 | |
4288 | 245 while (themes) { |
246 struct smiley_theme *theme = themes->data; | |
247 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" | |
4718 | 248 "<span size='smaller' foreground='dim grey'>%s</span>", |
249 theme->name, theme->author, theme->desc); | |
4324 | 250 gtk_list_store_append (smiley_theme_store, &iter); |
4288 | 251 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); |
4328 | 252 |
4324 | 253 gtk_list_store_set(smiley_theme_store, &iter, |
4288 | 254 0, pixbuf, |
255 1, description, | |
256 2, theme->path, | |
257 -1); | |
4892 | 258 g_object_unref(G_OBJECT(pixbuf)); |
4288 | 259 g_free(description); |
260 themes = themes->next; | |
261 if (current_smiley_theme && !strcmp(theme->path, current_smiley_theme->path)) { | |
262 /* path = gtk_tree_path_new_from_indices(ind); */ | |
263 char *iwishihadgtk2_2 = g_strdup_printf("%d", ind); | |
264 path = gtk_tree_path_new_from_string(iwishihadgtk2_2); | |
265 g_free(iwishihadgtk2_2); | |
266 } | |
267 ind++; | |
268 } | |
4325 | 269 |
4324 | 270 return path; |
271 } | |
4325 | 272 |
4326 | 273 void theme_install_theme(char *path, char *extn) { |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
274 #ifndef _WIN32 |
4325 | 275 gchar *command; |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
276 #endif |
4325 | 277 gchar *destdir; |
278 gchar *tail; | |
279 | |
280 /* Just to be safe */ | |
281 g_strchomp(path); | |
282 | |
283 /* I dont know what you are, get out of here */ | |
4326 | 284 if (extn != NULL) |
285 tail = extn; | |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
286 else if ((tail = strrchr(path, '.')) == NULL) |
4325 | 287 return; |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
288 |
4325 | 289 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL); |
290 | |
291 /* We'll check this just to make sure. This also lets us do something different on | |
292 * other platforms, if need be */ | |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
293 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) { |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
294 #ifndef _WIN32 |
5014 | 295 command = g_strdup_printf("tar > /dev/null xzf \"%s\" -C %s", path, destdir); |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
296 #else |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
297 if(!wgaim_gz_untar(path, destdir)) { |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
298 g_free(destdir); |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
299 return; |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
300 } |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
301 #endif |
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
302 } |
4325 | 303 else { |
304 g_free(destdir); | |
305 return; | |
306 } | |
307 | |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
308 #ifndef _WIN32 |
4325 | 309 /* Fire! */ |
310 system(command); | |
311 | |
312 g_free(command); | |
5007
414b6a68578f
[gaim-migrate @ 5342]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4994
diff
changeset
|
313 #endif |
4325 | 314 g_free(destdir); |
315 | |
316 theme_refresh_theme_list(); | |
317 } | |
318 | |
4326 | 319 static void theme_got_url(gpointer data, char *themedata, unsigned long len) { |
320 FILE *f; | |
321 gchar *path; | |
322 | |
323 f = gaim_mkstemp(&path); | |
324 fwrite(themedata, len, 1, f); | |
325 fclose(f); | |
326 | |
327 theme_install_theme(path, data); | |
328 | |
329 unlink(path); | |
330 g_free(path); | |
331 } | |
332 | |
4328 | 333 void theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, GtkSelectionData *sd, |
4325 | 334 guint info, guint t, gpointer data) { |
335 gchar *name = sd->data; | |
336 | |
337 if ((sd->length >= 0) && (sd->format == 8)) { | |
338 /* Well, it looks like the drag event was cool. | |
339 * Let's do something with it */ | |
340 | |
4793 | 341 if (!g_ascii_strncasecmp(name, "file://", 7)) { |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
342 GError *converr = NULL; |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
343 gchar *tmp; |
4325 | 344 /* It looks like we're dealing with a local file. Let's |
345 * just untar it in the right place */ | |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
346 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
347 gaim_debug(GAIM_DEBUG_ERROR, "theme dnd", "%s\n", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
348 (converr ? converr->message : |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
349 "g_filename_from_uri error")); |
5013
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
350 return; |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
351 } |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
352 theme_install_theme(tmp, NULL); |
e44e68aa6ea3
[gaim-migrate @ 5349]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5011
diff
changeset
|
353 g_free(tmp); |
4793 | 354 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
4326 | 355 /* Oo, a web drag and drop. This is where things |
356 * will start to get interesting */ | |
357 gchar *tail; | |
4328 | 358 |
4326 | 359 if ((tail = strrchr(name, '.')) == NULL) |
360 return; | |
361 | |
362 /* We'll check this just to make sure. This also lets us do something different on | |
363 * other platforms, if need be */ | |
4332
c8f374cadbd9
[gaim-migrate @ 4596]
Christian Hammond <chipx86@chipx86.com>
parents:
4330
diff
changeset
|
364 grab_url(name, TRUE, theme_got_url, ".tgz"); |
4325 | 365 } |
366 | |
367 gtk_drag_finish(dc, TRUE, FALSE, t); | |
368 } | |
369 | |
370 gtk_drag_finish(dc, FALSE, FALSE, t); | |
371 } | |
372 | |
4324 | 373 GtkWidget *theme_page() { |
374 GtkWidget *ret; | |
375 GtkWidget *sw; | |
376 GtkWidget *view; | |
377 GtkCellRenderer *rend; | |
378 GtkTreeViewColumn *col; | |
379 GtkTreeSelection *sel; | |
380 GtkTreePath *path = NULL; | |
4334 | 381 GtkWidget *label; |
4702 | 382 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}}; |
4324 | 383 |
384 ret = gtk_vbox_new(FALSE, 18); | |
385 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
386 | |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
387 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.")); |
4334 | 388 |
4339
78bc4c8e4b2e
[gaim-migrate @ 4603]
Christian Hammond <chipx86@chipx86.com>
parents:
4334
diff
changeset
|
389 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
4334 | 390 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
391 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); | |
392 | |
393 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0); | |
394 gtk_widget_show(label); | |
395 | |
4324 | 396 sw = gtk_scrolled_window_new(NULL,NULL); |
397 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
398 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
399 | |
400 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
401 smiley_theme_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
402 | |
403 path = theme_refresh_theme_list(); | |
4288 | 404 |
4324 | 405 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store)); |
4325 | 406 |
407 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te, | |
408 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE); | |
409 | |
410 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store); | |
411 | |
4288 | 412 rend = gtk_cell_renderer_pixbuf_new(); |
413 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); | |
4328 | 414 |
415 if(path) { | |
416 gtk_tree_selection_select_path(sel, path); | |
417 gtk_tree_path_free(path); | |
418 } | |
4288 | 419 |
4589 | 420 col = gtk_tree_view_column_new_with_attributes (_("Icon"), |
4288 | 421 rend, |
422 "pixbuf", 0, | |
423 NULL); | |
424 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
425 | |
426 rend = gtk_cell_renderer_text_new(); | |
4589 | 427 col = gtk_tree_view_column_new_with_attributes (_("Description"), |
4288 | 428 rend, |
429 "markup", 1, | |
430 NULL); | |
431 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col); | |
4324 | 432 g_object_unref(G_OBJECT(smiley_theme_store)); |
4288 | 433 gtk_container_add(GTK_CONTAINER(sw), view); |
434 | |
435 g_signal_connect (G_OBJECT (sel), "changed", | |
436 G_CALLBACK (smiley_sel), | |
437 NULL); | |
438 | |
439 | |
440 gtk_widget_show_all(ret); | |
441 return ret; | |
442 } | |
443 | |
3366 | 444 GtkWidget *font_page() { |
445 GtkWidget *ret; | |
446 GtkWidget *button; | |
447 GtkWidget *vbox, *hbox; | |
448 GtkWidget *select = NULL; | |
3427 | 449 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 450 |
3427 | 451 ret = gtk_vbox_new(FALSE, 18); |
452 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 453 |
3427 | 454 vbox = make_frame(ret, _("Style")); |
3818 | 455 gaim_button(_("_Bold"), &font_options, OPT_FONT_BOLD, vbox); |
456 gaim_button(_("_Italics"), &font_options, OPT_FONT_ITALIC, vbox); | |
457 gaim_button(_("_Underline"), &font_options, OPT_FONT_UNDERLINE, vbox); | |
4599 | 458 gaim_button(_("_Strikethrough"), &font_options, OPT_FONT_STRIKE, vbox); |
3500 | 459 |
3427 | 460 vbox = make_frame(ret, _("Face")); |
461 hbox = gtk_hbox_new(FALSE, 6); | |
462 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 463 button = gaim_button(_("Use custo_m face"), &font_options, OPT_FONT_FACE, hbox); |
3427 | 464 gtk_size_group_add_widget(sg, button); |
465 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT); | |
3366 | 466 |
3818 | 467 if (!(font_options & OPT_FONT_FACE)) |
3366 | 468 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
469 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
470 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
471 g_signal_connect(GTK_OBJECT(select), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
472 G_CALLBACK(show_font_dialog), NULL); |
3366 | 473 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); |
474 | |
475 hbox = gtk_hbox_new(FALSE, 5); | |
476 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3818 | 477 button = gaim_button(_("Use custom si_ze"), &font_options, OPT_FONT_SIZE, hbox); |
3427 | 478 gtk_size_group_add_widget(sg, button); |
3818 | 479 select = gaim_labeled_spin_button(hbox, NULL, &fontsize, 1, 7, NULL); |
480 if (!(font_options & OPT_FONT_SIZE)) | |
3366 | 481 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
482 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
483 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 484 |
3500 | 485 vbox = make_frame(ret, _("Color")); |
3366 | 486 hbox = gtk_hbox_new(FALSE, 5); |
487 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 488 |
489 | |
3818 | 490 button = gaim_button(_("_Text color"), &font_options, OPT_FONT_FGCOL, hbox); |
3427 | 491 gtk_size_group_add_widget(sg, button); |
492 | |
493 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
494 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 495 pref_fg_picture = show_color_pref(hbox, TRUE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
496 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 497 pref_fg_picture); |
3427 | 498 |
3818 | 499 if (!(font_options & OPT_FONT_FGCOL)) |
3366 | 500 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
501 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
502 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
503 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_fgcolor_dialog), NULL); |
3366 | 504 hbox = gtk_hbox_new(FALSE, 5); |
505 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 506 |
3818 | 507 button = gaim_button(_("Bac_kground color"), &font_options, OPT_FONT_BGCOL, hbox); |
3427 | 508 gtk_size_group_add_widget(sg, button); |
509 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR); | |
510 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0); | |
3366 | 511 pref_bg_picture = show_color_pref(hbox, FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
512 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(update_color), |
3366 | 513 pref_bg_picture); |
3472 | 514 |
3818 | 515 if (!(font_options & OPT_FONT_BGCOL)) |
3366 | 516 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
517 g_signal_connect(GTK_OBJECT(select), "clicked", G_CALLBACK(show_bgcolor_dialog), NULL); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
518 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
519 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
3366 | 520 |
3427 | 521 gtk_widget_show_all(ret); |
3366 | 522 return ret; |
523 } | |
524 | |
525 | |
526 GtkWidget *messages_page() { | |
527 GtkWidget *ret; | |
528 GtkWidget *vbox; | |
3427 | 529 ret = gtk_vbox_new(FALSE, 18); |
530 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 531 |
3427 | 532 vbox = make_frame (ret, _("Display")); |
3818 | 533 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); |
534 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); | |
535 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); | |
3803 | 536 #ifdef USE_GTKSPELL |
3818 | 537 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); |
3803 | 538 #endif |
3427 | 539 vbox = make_frame (ret, _("Ignore")); |
3818 | 540 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); |
541 gaim_button(_("Ignore font _faces"), &convo_options, OPT_CONVO_IGNORE_FONTS, vbox); | |
542 gaim_button(_("Ignore font si_zes"), &convo_options, OPT_CONVO_IGNORE_SIZES, vbox); | |
3500 | 543 |
3427 | 544 gtk_widget_show_all(ret); |
3366 | 545 return ret; |
546 } | |
547 | |
548 GtkWidget *hotkeys_page() { | |
549 GtkWidget *ret; | |
550 GtkWidget *vbox; | |
3427 | 551 ret = gtk_vbox_new(FALSE, 18); |
552 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 553 |
3427 | 554 vbox = make_frame(ret, _("Send Message")); |
3818 | 555 gaim_button(_("_Enter sends message"), &convo_options, OPT_CONVO_ENTER_SENDS, vbox); |
556 gaim_button(_("C_ontrol-Enter sends message"), &convo_options, OPT_CONVO_CTL_ENTER, vbox); | |
3500 | 557 |
3427 | 558 vbox = make_frame (ret, _("Window Closing")); |
3818 | 559 gaim_button(_("E_scape closes window"), &convo_options, OPT_CONVO_ESC_CAN_CLOSE, vbox); |
560 gaim_button(_("Control-_W closes window"), &convo_options, OPT_CONVO_CTL_W_CLOSES, vbox); | |
3366 | 561 |
3427 | 562 vbox = make_frame(ret, "Insertions"); |
3818 | 563 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options, OPT_CONVO_CTL_CHARS, vbox); |
564 gaim_button(_("Control-(number) inserts _smileys"), &convo_options, OPT_CONVO_CTL_SMILEYS, vbox); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
565 |
3427 | 566 gtk_widget_show_all(ret); |
3366 | 567 return ret; |
568 } | |
569 | |
570 GtkWidget *list_page() { | |
571 GtkWidget *ret; | |
572 GtkWidget *vbox; | |
4985 | 573 GtkWidget *button, *b2; |
3427 | 574 ret = gtk_vbox_new(FALSE, 18); |
575 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 576 |
4956 | 577 vbox = make_frame (ret, _("Buddy List Toolbar")); |
4944 | 578 gaim_dropdown(vbox, _("Show _buttons as:"), &blist_options, OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, |
579 _("Pictures"), OPT_BLIST_SHOW_BUTTON_XPM | OPT_BLIST_NO_BUTTON_TEXT, | |
580 _("Text"), 0, | |
581 _("Pictures and text"), OPT_BLIST_SHOW_BUTTON_XPM, | |
582 _("None"), OPT_BLIST_NO_BUTTON_TEXT, NULL); | |
3366 | 583 |
3427 | 584 vbox = make_frame (ret, _("Buddy List Window")); |
4045 | 585 gaim_button(_("_Raise window on events"), &blist_options, OPT_BLIST_POPUP, vbox); |
3366 | 586 |
4980 | 587 vbox = make_frame (ret, _("Group Display")); |
4700 | 588 /* gaim_button(_("Hide _groups with no online buddies"), &blist_options, OPT_BLIST_NO_MT_GRP, vbox); */ |
4980 | 589 gaim_button(_("Show _numbers in groups"), &blist_options, OPT_BLIST_SHOW_GRPNUM, vbox); |
3366 | 590 |
3427 | 591 vbox = make_frame (ret, _("Buddy Display")); |
4985 | 592 button = gaim_button(_("Show buddy _icons"), &blist_options, OPT_BLIST_SHOW_ICONS, vbox); |
593 b2 = gaim_button(_("Show _warning levels"), &blist_options, OPT_BLIST_SHOW_WARN, vbox); | |
594 if (blist_options & OPT_BLIST_SHOW_ICONS) | |
595 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); | |
596 g_signal_connect(GTK_OBJECT(button), "clicked", | |
597 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); | |
598 b2 = gaim_button(_("Show idle _times"), &blist_options, OPT_BLIST_SHOW_IDLETIME, vbox); | |
599 if (blist_options & OPT_BLIST_SHOW_ICONS) | |
600 gtk_widget_set_sensitive(GTK_WIDGET(b2), FALSE); | |
601 g_signal_connect(GTK_OBJECT(button), "clicked", | |
602 G_CALLBACK(gaim_gtk_toggle_sensitive), b2); | |
4944 | 603 gaim_button(_("Dim i_dle buddies"), &blist_options, OPT_BLIST_GREY_IDLERS, vbox); |
3366 | 604 |
3427 | 605 gtk_widget_show_all(ret); |
3366 | 606 return ret; |
607 } | |
608 | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
609 GtkWidget *conv_page() { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
610 GtkWidget *ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
611 GtkWidget *vbox; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
612 GtkWidget *label; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
613 GtkSizeGroup *sg; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
614 GList *names = NULL; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
615 int i; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
616 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
617 ret = gtk_vbox_new(FALSE, 18); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
618 gtk_container_set_border_width(GTK_CONTAINER(ret), 12); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
619 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
620 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
621 vbox = make_frame(ret, _("Conversations")); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
622 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
623 /* Build a list of names. */ |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
624 for (i = 0; i < gaim_conv_placement_get_fnc_count(); i++) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
625 names = g_list_append(names, (char *)gaim_conv_placement_get_name(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
626 names = g_list_append(names, GINT_TO_POINTER(i)); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
627 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
628 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
629 label = gaim_dropdown_from_list(vbox, _("_Placement:"), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
630 &conv_placement_option, -1, names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
631 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
632 g_list_free(names); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
633 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
634 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
635 gtk_size_group_add_widget(sg, label); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
636 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
637 gaim_button(_("Show IMs and chats in _same tabbed window."), |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
638 &convo_options, OPT_CONVO_COMBINE, vbox); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
639 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
640 gtk_widget_show_all(ret); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
641 |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
642 return ret; |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
643 } |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
644 |
3366 | 645 GtkWidget *im_page() { |
646 GtkWidget *ret; | |
3500 | 647 GtkWidget *vbox; |
3427 | 648 GtkWidget *typingbutton, *widge; |
649 GtkSizeGroup *sg; | |
3366 | 650 |
3427 | 651 ret = gtk_vbox_new(FALSE, 18); |
652 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
653 | |
654 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
655 | |
656 vbox = make_frame (ret, _("Window")); | |
4114 | 657 widge = gaim_dropdown(vbox, _("Show _buttons as:"), &im_options, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM, |
658 _("Pictures"), OPT_IM_BUTTON_XPM, | |
659 _("Text"), OPT_IM_BUTTON_TEXT, | |
660 _("Pictures and text"), OPT_IM_BUTTON_XPM | OPT_IM_BUTTON_TEXT, NULL); | |
3427 | 661 gtk_size_group_add_widget(sg, widge); |
662 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0); | |
3818 | 663 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size.width, 25, 9999, sg); |
664 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size.height, 25, 9999, sg); | |
5281 | 665 gaim_labeled_spin_button(vbox, _("_Entry field height:"), &conv_size.entry_height, 25, 9999, sg); |
3818 | 666 gaim_button(_("_Raise windows on events"), &im_options, OPT_IM_POPUP, vbox); |
667 gaim_button(_("Hide window on _send"), &im_options, OPT_IM_POPDOWN, vbox); | |
3366 | 668 gtk_widget_show (vbox); |
669 | |
3427 | 670 vbox = make_frame (ret, _("Buddy Icons")); |
4045 | 671 gaim_button(_("Hide buddy _icons"), &im_options, OPT_IM_HIDE_ICONS, vbox); |
672 gaim_button(_("Disable buddy icon a_nimation"), &im_options, OPT_IM_NO_ANIMATION, vbox); | |
3366 | 673 |
3427 | 674 vbox = make_frame (ret, _("Display")); |
3818 | 675 gaim_button(_("Show _logins in window"), &im_options, OPT_IM_LOGON, vbox); |
4991 | 676 gaim_button(_("Show a_liases in tabs/titles"), &im_options, OPT_IM_ALIAS_TAB, vbox); |
3366 | 677 |
3427 | 678 vbox = make_frame (ret, _("Typing Notification")); |
3818 | 679 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options, |
3366 | 680 OPT_MISC_STEALTH_TYPING, vbox); |
681 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton))); | |
3818 | 682 misc_options ^= OPT_MISC_STEALTH_TYPING; |
3366 | 683 |
3427 | 684 gtk_widget_show_all(ret); |
3366 | 685 return ret; |
686 } | |
687 | |
688 GtkWidget *chat_page() { | |
689 GtkWidget *ret; | |
690 GtkWidget *vbox; | |
3427 | 691 GtkWidget *dd; |
692 GtkSizeGroup *sg; | |
3366 | 693 |
3427 | 694 ret = gtk_vbox_new(FALSE, 18); |
695 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3500 | 696 |
3427 | 697 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); |
3366 | 698 |
3427 | 699 vbox = make_frame (ret, _("Window")); |
4114 | 700 dd = gaim_dropdown(vbox, _("Show _buttons as:"), &chat_options, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM, |
701 _("Pictures"), OPT_CHAT_BUTTON_XPM, | |
702 _("Text"), OPT_CHAT_BUTTON_TEXT, | |
703 _("Pictures and text"), OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL); | |
3427 | 704 gtk_size_group_add_widget(sg, dd); |
705 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
3818 | 706 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size.width, 25, 9999, sg); |
707 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size.height, 25, 9999, sg); | |
5281 | 708 gaim_labeled_spin_button(vbox, _("_Entry field height:"), &buddy_chat_size.entry_height, 25, 9999, sg); |
3818 | 709 gaim_button(_("_Raise windows on events"), &chat_options, OPT_CHAT_POPUP, vbox); |
3366 | 710 |
3427 | 711 vbox = make_frame (ret, _("Tab Completion")); |
4045 | 712 gaim_button(_("_Tab-complete nicks"), &chat_options, OPT_CHAT_TAB_COMPLETE, vbox); |
713 gaim_button(_("_Old-style tab completion"), &chat_options, OPT_CHAT_OLD_STYLE_TAB, vbox); | |
3427 | 714 |
715 vbox = make_frame (ret, _("Display")); | |
3818 | 716 gaim_button(_("_Show people joining/leaving in window"), &chat_options, OPT_CHAT_LOGON, vbox); |
717 gaim_button(_("Co_lorize screennames"), &chat_options, OPT_CHAT_COLORIZE, vbox); | |
3427 | 718 |
719 gtk_widget_show_all(ret); | |
3366 | 720 return ret; |
721 } | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
722 |
3366 | 723 GtkWidget *tab_page() { |
724 GtkWidget *ret; | |
725 GtkWidget *vbox; | |
3427 | 726 GtkWidget *dd; |
4445 | 727 GtkWidget *button; |
3427 | 728 GtkSizeGroup *sg; |
729 ret = gtk_vbox_new(FALSE, 18); | |
730 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 731 |
3427 | 732 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
3500 | 733 |
3427 | 734 vbox = make_frame (ret, _("IM Tabs")); |
4114 | 735 dd = gaim_dropdown(vbox, _("Tab _placement:"), &im_options, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB, |
736 _("Top"), 0, | |
737 _("Bottom"), OPT_IM_BR_TAB, | |
738 _("Left"), OPT_IM_SIDE_TAB, | |
739 _("Right"), OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL); | |
3427 | 740 gtk_size_group_add_widget(sg, dd); |
4045 | 741 gaim_button(_("Show all _instant messages in one tabbed\nwindow"), &im_options, OPT_IM_ONE_WINDOW, vbox); |
4991 | 742 |
3366 | 743 |
3427 | 744 vbox = make_frame (ret, _("Chat Tabs")); |
4114 | 745 dd = gaim_dropdown(vbox, _("Tab _placement:"), &chat_options, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, |
746 _("Top"), 0, | |
747 _("Bottom"), OPT_CHAT_BR_TAB, | |
748 _("Left"), OPT_CHAT_SIDE_TAB, | |
749 _("Right"), OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL); | |
3427 | 750 gtk_size_group_add_widget(sg, dd); |
3818 | 751 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options, OPT_CHAT_ONE_WINDOW, |
3366 | 752 vbox); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
753 |
4445 | 754 vbox = make_frame (ret, _("Tab Options")); |
755 button = gaim_button(_("Show _close button on tabs."), &convo_options, OPT_CONVO_NO_X_ON_TAB, vbox); | |
4449 | 756 convo_options ^= OPT_CONVO_NO_X_ON_TAB; |
4445 | 757 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); |
758 | |
759 | |
3427 | 760 gtk_widget_show_all(ret); |
3366 | 761 return ret; |
762 } | |
763 | |
764 GtkWidget *proxy_page() { | |
765 GtkWidget *ret; | |
766 GtkWidget *vbox; | |
767 GtkWidget *entry; | |
768 GtkWidget *label; | |
769 GtkWidget *hbox; | |
770 GtkWidget *table; | |
771 | |
3427 | 772 ret = gtk_vbox_new(FALSE, 18); |
773 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 774 |
3427 | 775 vbox = make_frame (ret, _("Proxy Type")); |
4634 | 776 gaim_dropdown(vbox, _("Proxy _type:"), (int*)&global_proxy_info.proxytype, -1, |
4114 | 777 _("No proxy"), PROXY_NONE, |
3366 | 778 "SOCKS 4", PROXY_SOCKS4, |
779 "SOCKS 5", PROXY_SOCKS5, | |
780 "HTTP", PROXY_HTTP, NULL); | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
781 |
3427 | 782 vbox = make_frame(ret, _("Proxy Server")); |
783 prefs_proxy_frame = vbox; | |
2254 | 784 |
4634 | 785 if (global_proxy_info.proxytype == PROXY_NONE) |
3427 | 786 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE); |
2254 | 787 |
788 table = gtk_table_new(2, 4, FALSE); | |
789 gtk_container_set_border_width(GTK_CONTAINER(table), 5); | |
790 gtk_table_set_col_spacings(GTK_TABLE(table), 5); | |
791 gtk_table_set_row_spacings(GTK_TABLE(table), 10); | |
3427 | 792 gtk_container_add(GTK_CONTAINER(vbox), table); |
2254 | 793 |
794 | |
3427 | 795 label = gtk_label_new_with_mnemonic(_("_Host")); |
2254 | 796 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
797 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
798 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
799 entry = gtk_entry_new(); |
3427 | 800 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 801 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
802 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
803 G_CALLBACK(proxy_print_option), (void *)PROXYHOST); |
4634 | 804 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyhost); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
805 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
806 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
807 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
808 |
3427 | 809 label = gtk_label_new_with_mnemonic(_("Port")); |
2254 | 810 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
811 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
812 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
813 entry = gtk_entry_new(); |
3427 | 814 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 815 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
816 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
817 G_CALLBACK(proxy_print_option), (void *)PROXYPORT); |
2254 | 818 |
4634 | 819 if (global_proxy_info.proxyport) { |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
820 char buf[128]; |
4634 | 821 g_snprintf(buf, sizeof(buf), "%d", global_proxy_info.proxyport); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
822 gtk_entry_set_text(GTK_ENTRY(entry), buf); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
823 } |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
824 |
3427 | 825 label = gtk_label_new_with_mnemonic(_("_User")); |
2254 | 826 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
827 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
828 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
829 entry = gtk_entry_new(); |
3427 | 830 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 831 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
832 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
833 G_CALLBACK(proxy_print_option), (void *)PROXYUSER); |
4634 | 834 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxyuser); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
835 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
836 hbox = gtk_hbox_new(TRUE, 5); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
837 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
838 |
3427 | 839 label = gtk_label_new_with_mnemonic(_("Pa_ssword")); |
2254 | 840 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); |
841 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
842 |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
843 entry = gtk_entry_new(); |
3427 | 844 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); |
3366 | 845 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 3, 4, GTK_FILL , 0, 0, 0); |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
846 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
847 g_signal_connect(GTK_OBJECT(entry), "changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
848 G_CALLBACK(proxy_print_option), (void *)PROXYPASS); |
4634 | 849 gtk_entry_set_text(GTK_ENTRY(entry), global_proxy_info.proxypass); |
3500 | 850 |
3427 | 851 gtk_widget_show_all(ret); |
3366 | 852 return ret; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
853 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
854 |
3821 | 855 #ifndef _WIN32 |
4978 | 856 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { |
857 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); | |
858 | |
4428 | 859 if (!program_is_valid(program)) { |
860 char *error = g_strdup_printf(_("The entered manual browser " | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
861 "'%s' is not valid. Hyperlinks will " |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
862 "not work."), program); |
4428 | 863 do_error_dialog(error, NULL, GAIM_WARNING); |
864 } | |
865 | |
866 g_strlcpy(web_command, program, sizeof(web_command)); | |
4978 | 867 |
868 /* carry on normally */ | |
869 return FALSE; | |
3432 | 870 } |
871 | |
4428 | 872 static GList *get_available_browsers() |
873 { | |
874 struct browser { | |
875 char *name; | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
876 char *command; |
4428 | 877 int id; |
878 }; | |
879 | |
880 static struct browser possible_browsers[] = { | |
881 {N_("Konqueror"), "kfmclient", BROWSER_KONQ}, | |
882 {N_("Opera"), "opera", BROWSER_OPERA}, | |
883 {N_("Galeon"), "galeon", BROWSER_GALEON}, | |
884 {N_("Netscape"), "netscape", BROWSER_NETSCAPE}, | |
885 {N_("Mozilla"), "mozilla", BROWSER_MOZILLA}, | |
886 }; | |
887 static const int num_possible_browsers = 5; | |
888 | |
889 GList *browsers = NULL; | |
890 int i = 0; | |
891 | |
892 browsers = g_list_prepend(browsers, GINT_TO_POINTER(BROWSER_MANUAL)); | |
893 browsers = g_list_prepend(browsers, _("Manual")); | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
894 for (i = 0; i < num_possible_browsers; i++) { |
4428 | 895 if (program_is_valid(possible_browsers[i].command)) { |
896 browsers = g_list_prepend(browsers, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
897 GINT_TO_POINTER(possible_browsers[i].id)); |
4428 | 898 browsers = g_list_prepend(browsers, possible_browsers[i].name); |
899 } | |
900 } | |
901 | |
902 return browsers; | |
903 } | |
904 | |
3366 | 905 GtkWidget *browser_page() { |
906 GtkWidget *ret; | |
3821 | 907 GtkWidget *vbox; |
908 GtkWidget *hbox; | |
3366 | 909 GtkWidget *label; |
3427 | 910 GtkSizeGroup *sg; |
4428 | 911 GList *browsers = NULL; |
3427 | 912 |
913 ret = gtk_vbox_new(FALSE, 18); | |
914 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915 | |
916 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
917 vbox = make_frame (ret, _("Browser Selection")); | |
4428 | 918 |
919 browsers = get_available_browsers(); | |
920 if (browsers != NULL) { | |
921 label = gaim_dropdown_from_list(vbox,_("_Browser"), &web_browser, -1, | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
922 browsers); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
923 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
924 gtk_size_group_add_widget(sg, label); |
4428 | 925 } |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
926 |
3366 | 927 hbox = gtk_hbox_new(FALSE, 5); |
928 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
4295 | 929 label = gtk_label_new_with_mnemonic(_("_Manual: ")); |
3366 | 930 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
3427 | 931 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
932 gtk_size_group_add_widget(sg, label); | |
4978 | 933 |
3366 | 934 browser_entry = gtk_entry_new(); |
3427 | 935 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
3818 | 936 if (web_browser != BROWSER_MANUAL) |
4428 | 937 gtk_widget_set_sensitive(hbox, FALSE); |
3366 | 938 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
939 |
3818 | 940 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
4978 | 941 g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", G_CALLBACK(manual_browser_set), NULL); |
4428 | 942 |
943 if (browsers != NULL) { | |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
944 vbox = make_frame (ret, _("Browser Options")); |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
945 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
4428 | 946 } |
4451
ce5b64fac95d
[gaim-migrate @ 4726]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4449
diff
changeset
|
947 |
3427 | 948 gtk_widget_show_all(ret); |
3366 | 949 return ret; |
3500 | 950 } |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
951 #endif /*_WIN32*/ |
3366 | 952 |
953 GtkWidget *logging_page() { | |
954 GtkWidget *ret; | |
955 GtkWidget *vbox; | |
3427 | 956 ret = gtk_vbox_new(FALSE, 18); |
957 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
958 |
3427 | 959 vbox = make_frame (ret, _("Message Logs")); |
4045 | 960 gaim_button(_("_Log all instant messages"), &logging_options, OPT_LOG_CONVOS, vbox); |
3818 | 961 gaim_button(_("Log all c_hats"), &logging_options, OPT_LOG_CHATS, vbox); |
962 gaim_button(_("Strip _HTML from logs"), &logging_options, OPT_LOG_STRIP_HTML, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
963 |
3427 | 964 vbox = make_frame (ret, _("System Logs")); |
3818 | 965 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options, OPT_LOG_BUDDY_SIGNON, |
3366 | 966 vbox); |
3818 | 967 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options, OPT_LOG_BUDDY_IDLE, |
3366 | 968 vbox); |
3818 | 969 gaim_button(_("Log when buddies go away/come _back"), &logging_options, OPT_LOG_BUDDY_AWAY, vbox); |
970 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options, OPT_LOG_MY_SIGNON, | |
3366 | 971 vbox); |
3818 | 972 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options, |
3366 | 973 OPT_LOG_INDIVIDUAL, vbox); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
974 |
3427 | 975 gtk_widget_show_all(ret); |
3366 | 976 return ret; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
977 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
978 |
3366 | 979 static GtkWidget *sndcmd = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1755
diff
changeset
|
980 |
3821 | 981 #ifndef _WIN32 |
4095 | 982 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d) |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
983 { |
4561 | 984 gaim_sound_set_command(gtk_entry_get_text(GTK_ENTRY(sndcmd))); |
3366 | 985 return TRUE; |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
986 } |
3821 | 987 #endif |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
988 |
3366 | 989 GtkWidget *sound_page() { |
990 GtkWidget *ret; | |
3821 | 991 GtkWidget *vbox; |
992 GtkSizeGroup *sg; | |
993 #ifndef _WIN32 | |
994 GtkWidget *dd; | |
995 GtkWidget *hbox; | |
1750
d2eca7a46cfd
[gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1711
diff
changeset
|
996 GtkWidget *label; |
4561 | 997 char *cmd; |
3821 | 998 #endif |
3366 | 999 |
3427 | 1000 ret = gtk_vbox_new(FALSE, 18); |
1001 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1002 |
3427 | 1003 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1004 |
3427 | 1005 vbox = make_frame (ret, _("Sound Options")); |
3818 | 1006 gaim_button(_("_No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, vbox); |
1007 gaim_button(_("_Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, vbox); | |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
1008 |
3630 | 1009 #ifndef _WIN32 |
3427 | 1010 vbox = make_frame (ret, _("Sound Method")); |
4114 | 1011 dd = gaim_dropdown(vbox, _("_Method"), &sound_options, OPT_SOUND_BEEP | |
4581 | 1012 OPT_SOUND_ESD | OPT_SOUND_ARTS | OPT_SOUND_NAS | |
1013 OPT_SOUND_NORMAL | OPT_SOUND_CMD, | |
4114 | 1014 _("Console beep"), OPT_SOUND_BEEP, |
4561 | 1015 #ifdef USE_AO |
1016 _("Automatic"), OPT_SOUND_NORMAL, | |
4581 | 1017 "ESD", OPT_SOUND_ESD, |
1018 "Arts", OPT_SOUND_ARTS, | |
1019 #endif | |
1020 #ifdef USE_NAS_AUDIO | |
1021 "NAS", OPT_SOUND_NAS, | |
4082 | 1022 #endif |
4114 | 1023 _("Command"), OPT_SOUND_CMD, NULL); |
3427 | 1024 gtk_size_group_add_widget(sg, dd); |
1025 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1026 |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1027 hbox = gtk_hbox_new(FALSE, 5); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1028 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); |
3427 | 1029 |
3366 | 1030 hbox = gtk_hbox_new(FALSE, 5); |
1031 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3500 | 1032 label = gtk_label_new_with_mnemonic(_("Sound c_ommand\n(%s for filename)")); |
3427 | 1033 gtk_size_group_add_widget(sg, label); |
1034 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1035 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
910
diff
changeset
|
1036 |
3366 | 1037 sndcmd = gtk_entry_new(); |
3427 | 1038 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1039 |
4635 | 1040 gtk_editable_set_editable(GTK_EDITABLE(sndcmd), TRUE); |
4561 | 1041 cmd = gaim_sound_get_command(); |
1042 if(cmd) | |
1043 gtk_entry_set_text(GTK_ENTRY(sndcmd), cmd); | |
3366 | 1044 gtk_widget_set_size_request(sndcmd, 75, -1); |
3427 | 1045 |
3818 | 1046 gtk_widget_set_sensitive(sndcmd, (sound_options & OPT_SOUND_CMD)); |
3366 | 1047 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1048 g_signal_connect(GTK_OBJECT(sndcmd), "changed", G_CALLBACK(sound_cmd_yeah), NULL); |
3630 | 1049 #endif /* _WIN32 */ |
3427 | 1050 gtk_widget_show_all(ret); |
3366 | 1051 return ret; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1052 } |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1053 |
3366 | 1054 GtkWidget *away_page() { |
1055 GtkWidget *ret; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1056 GtkWidget *vbox; |
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1057 GtkWidget *hbox; |
3366 | 1058 GtkWidget *label; |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1059 GtkWidget *button; |
3366 | 1060 GtkWidget *select; |
3427 | 1061 GtkWidget *dd; |
1062 GtkSizeGroup *sg; | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1063 |
3427 | 1064 ret = gtk_vbox_new(FALSE, 18); |
1065 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
1066 |
3427 | 1067 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1068 |
3427 | 1069 vbox = make_frame (ret, _("Away")); |
3818 | 1070 gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); |
1071 gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1072 |
3427 | 1073 vbox = make_frame (ret, _("Auto-response")); |
3366 | 1074 hbox = gtk_hbox_new(FALSE, 0); |
1075 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
3427 | 1076 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"), |
3818 | 1077 &away_resend, 1, 24 * 60 * 60, sg); |
1078 gaim_button(_("_Don't send auto-response"), &away_options, OPT_AWAY_NO_AUTO_RESP, vbox); | |
1079 gaim_button(_("_Only send auto-response when idle"), &away_options, OPT_AWAY_IDLE_RESP, vbox); | |
1080 gaim_button(_("Do_n't send auto-response in active conversations"), &away_options, OPT_AWAY_DELAY_IN_USE, vbox); | |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1805
diff
changeset
|
1081 |
3818 | 1082 if (away_options & OPT_AWAY_NO_AUTO_RESP) |
3366 | 1083 gtk_widget_set_sensitive(hbox, FALSE); |
3500 | 1084 |
3427 | 1085 vbox = make_frame (ret, _("Idle")); |
4052 | 1086 dd = gaim_dropdown(vbox, _("Idle _time reporting:"), &report_idle, -1, |
1087 _("None"), IDLE_NONE, | |
1088 _("Gaim usage"), IDLE_GAIM, | |
3366 | 1089 #ifdef USE_SCREENSAVER |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1090 #ifndef _WIN32 |
4052 | 1091 _("X usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1092 #else |
4052 | 1093 _("Windows usage"), IDLE_SCREENSAVER, |
3905
3e508dd31b76
[gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3902
diff
changeset
|
1094 #endif |
3366 | 1095 #endif |
3427 | 1096 NULL); |
1097 gtk_size_group_add_widget(sg, dd); | |
1098 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0); | |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1099 |
3427 | 1100 vbox = make_frame (ret, _("Auto-away")); |
3818 | 1101 button = gaim_button(_("Set away _when idle"), &away_options, OPT_AWAY_AUTO, vbox); |
4052 | 1102 select = gaim_labeled_spin_button(vbox, _("_Minutes before setting away:"), &auto_away, 1, 24 * 60, sg); |
3818 | 1103 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1104 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1105 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1106 G_CALLBACK(gaim_gtk_toggle_sensitive), select); |
1 | 1107 |
4052 | 1108 label = gtk_label_new_with_mnemonic(_("Away m_essage:")); |
3427 | 1109 gtk_size_group_add_widget(sg, label); |
1110 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3366 | 1111 hbox = gtk_hbox_new(FALSE, 0); |
1112 gtk_container_add(GTK_CONTAINER(vbox), hbox); | |
1113 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
1114 prefs_away_menu = gtk_option_menu_new(); | |
3427 | 1115 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu); |
3818 | 1116 if (!(away_options & OPT_AWAY_AUTO)) |
3366 | 1117 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1118 g_signal_connect(GTK_OBJECT(button), "clicked", |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1119 G_CALLBACK(gaim_gtk_toggle_sensitive), prefs_away_menu); |
3366 | 1120 default_away_menu_init(prefs_away_menu); |
1121 gtk_widget_show(prefs_away_menu); | |
1122 gtk_box_pack_start(GTK_BOX(hbox), prefs_away_menu, FALSE, FALSE, 0); | |
3500 | 1123 |
3427 | 1124 gtk_widget_show_all(ret); |
3366 | 1125 return ret; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1126 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1127 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1128 static GtkWidget *plugin_description=NULL, *plugin_details=NULL; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1129 |
3551 | 1130 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model) |
1131 { | |
1132 gchar buf[1024]; | |
1133 GtkTreeIter iter; | |
1134 GValue val = { 0, }; | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1135 GaimPlugin *plug; |
3551 | 1136 |
1137 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) | |
1138 return; | |
1139 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1140 plug = g_value_get_pointer(&val); | |
1141 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1142 if (plug->error != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1143 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1144 "<span size=\"larger\">%s %s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1145 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1146 "%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1147 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1148 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1149 g_markup_escape_text(plug->error, -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1150 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1151 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1152 else { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1153 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1154 "<span size=\"larger\">%s %s</span>\n\n%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1155 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1156 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1157 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1158 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1159 |
3551 | 1160 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
3630 | 1161 g_snprintf(buf, sizeof(buf), |
1162 #ifndef _WIN32 | |
1163 _("<span size=\"larger\">%s %s</span>\n\n" | |
1164 "<span weight=\"bold\">Written by:</span>\t%s\n" | |
4617 | 1165 "<span weight=\"bold\">Web site:</span>\t\t%s\n" |
3630 | 1166 "<span weight=\"bold\">File name:</span>\t%s"), |
1167 #else | |
1168 _("<span size=\"larger\">%s %s</span>\n\n" | |
1169 "<span weight=\"bold\">Written by:</span> %s\n" | |
1170 "<span weight=\"bold\">URL:</span> %s\n" | |
1171 "<span weight=\"bold\">File name:</span> %s"), | |
1172 #endif | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1173 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1174 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1175 g_markup_escape_text(_(plug->info->author), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1176 g_markup_escape_text(plug->info->homepage, -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1177 plug->path); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1178 |
3551 | 1179 gtk_label_set_markup(GTK_LABEL(plugin_details), buf); |
1180 g_value_unset (&val); | |
1181 } | |
1182 | |
1183 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data) | |
1184 { | |
1185 GtkTreeModel *model = (GtkTreeModel *)data; | |
1186 GtkTreeIter iter; | |
1187 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1188 GaimPlugin *plug; |
3551 | 1189 gchar buf[1024]; |
3565 | 1190 |
3551 | 1191 GdkCursor *wait = gdk_cursor_new (GDK_WATCH); |
1192 gdk_window_set_cursor(prefs->window, wait); | |
1193 gdk_cursor_unref(wait); | |
1194 | |
1195 gtk_tree_model_get_iter (model, &iter, path); | |
1196 gtk_tree_model_get (model, &iter, 2, &plug, -1); | |
1197 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1198 if (!gaim_plugin_is_loaded(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1199 gaim_plugin_load(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1200 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1201 /* |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1202 * NOTE: This is basically the same check as before |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1203 * (plug->type == plugin), but now there aren't plugin types. |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1204 * Not yet, anyway. I want to do a V2 of the plugin API. |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1205 * The thing is, we should have a flag specifying the UI type, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1206 * or just whether it's a general plugin or a UI-specific |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1207 * plugin. We should only load this if it's UI-specific. |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1208 * |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1209 * -- ChipX86 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1210 */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1211 if (GAIM_IS_GTK_PLUGIN(plug)) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1212 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1213 GtkWidget *config_frame; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1214 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1215 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1216 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1217 config_frame = gaim_gtk_plugin_get_config_frame(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1218 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1219 if (config_frame != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1220 ui_info->iter = g_new0(GtkTreeIter, 1); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1221 prefs_notebook_add_page(_(plug->info->name), NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1222 config_frame, ui_info->iter, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1223 &plugin_iter, notebook_page++); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1224 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1225 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1226 &plugin_iter) == 1) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1227 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1228 /* Expand the tree for the first plugin added */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1229 GtkTreePath *path2; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1230 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1231 path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1232 &plugin_iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1233 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1234 path2, TRUE); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1235 gtk_tree_path_free(path2); |
3565 | 1236 } |
1237 } | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1238 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1239 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1240 else { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1241 if (GAIM_IS_GTK_PLUGIN(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1242 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1243 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1244 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1245 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1246 if (ui_info != NULL && ui_info->iter != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1247 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), ui_info->iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1248 g_free(ui_info->iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1249 ui_info->iter = NULL; |
3565 | 1250 } |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1251 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1252 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1253 gaim_plugin_unload(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1254 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1255 |
3551 | 1256 gdk_window_set_cursor(prefs->window, NULL); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1257 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1258 if (plug->error != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1259 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1260 "<span size=\"larger\">%s %s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1261 "<span weight=\"bold\" color=\"red\">%s</span>\n\n" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1262 "%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1263 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1264 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1265 g_markup_escape_text(plug->error, -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1266 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1267 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1268 else { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1269 g_snprintf(buf, sizeof(buf), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1270 "<span size=\"larger\">%s %s</span>\n\n%s", |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1271 g_markup_escape_text(_(plug->info->name), -1), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1272 plug->info->version, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1273 g_markup_escape_text(_(plug->info->description), -1)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1274 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1275 |
3563 | 1276 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1277 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1278 gaim_plugin_is_loaded(plug), -1); |
3563 | 1279 |
3551 | 1280 gtk_label_set_markup(GTK_LABEL(plugin_description), buf); |
1281 gtk_tree_path_free(path); | |
1282 } | |
1283 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1284 static void |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1285 update_plugin_list(void *data) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1286 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1287 GtkListStore *ls = GTK_LIST_STORE(data); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1288 GtkTreeIter iter; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1289 GList *probes; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1290 GaimPlugin *plug; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1291 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1292 gtk_list_store_clear(ls); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1293 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1294 for (probes = gaim_plugins_get_all(); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1295 probes != NULL; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1296 probes = probes->next) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1297 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1298 plug = probes->data; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1299 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1300 if (plug->info->type != GAIM_PLUGIN_STANDARD) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1301 continue; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1302 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1303 gtk_list_store_append (ls, &iter); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1304 gtk_list_store_set(ls, &iter, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1305 0, gaim_plugin_is_loaded(plug), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1306 1, plug->info->name ? _(plug->info->name) : plug->path, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1307 2, plug, -1); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1308 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1309 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1310 |
3551 | 1311 static GtkWidget *plugin_page () |
1312 { | |
1313 GtkWidget *ret; | |
1314 GtkWidget *sw, *vp; | |
1315 GtkWidget *event_view; | |
1316 GtkListStore *ls; | |
1317 GtkCellRenderer *rend, *rendt; | |
1318 GtkTreeViewColumn *col; | |
1319 GtkTreeSelection *sel; | |
1320 GtkTreePath *path; | |
1321 GtkWidget *nb; | |
1322 | |
1323 ret = gtk_vbox_new(FALSE, 18); | |
1324 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1325 | |
1326 sw = gtk_scrolled_window_new(NULL,NULL); | |
1327 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); | |
1328 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1329 | |
1330 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); | |
1331 | |
1332 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1333 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1334 update_plugin_list(ls); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1335 |
3551 | 1336 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(ls)); |
1337 | |
1338 rend = gtk_cell_renderer_toggle_new(); | |
1339 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1340 | |
1341 | |
4295 | 1342 col = gtk_tree_view_column_new_with_attributes (_("Load"), |
3551 | 1343 rend, |
1344 "active", 0, | |
1345 NULL); | |
1346 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1347 | |
1348 rendt = gtk_cell_renderer_text_new(); | |
4295 | 1349 col = gtk_tree_view_column_new_with_attributes (_("Name"), |
3551 | 1350 rendt, |
1351 "text", 1, | |
1352 NULL); | |
1353 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1354 g_object_unref(G_OBJECT(ls)); | |
1355 gtk_container_add(GTK_CONTAINER(sw), event_view); | |
1356 | |
1357 | |
1358 nb = gtk_notebook_new(); | |
1359 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM); | |
1360 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb)); | |
1361 | |
1362 /* Description */ | |
1363 sw = gtk_scrolled_window_new(NULL, NULL); | |
1364 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1365 plugin_description = gtk_label_new(NULL); | |
1366 | |
1367 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1368 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1369 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1370 | |
3630 | 1371 gtk_container_add(GTK_CONTAINER(vp), plugin_description); |
1372 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1373 |
3630 | 1374 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE); |
1375 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE); | |
3551 | 1376 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0); |
1377 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6); | |
1378 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Description"))); | |
1379 | |
1380 /* Details */ | |
1381 sw = gtk_scrolled_window_new(NULL, NULL); | |
1382 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
1383 plugin_details = gtk_label_new(NULL); | |
1384 | |
1385 vp = gtk_viewport_new(NULL, NULL); | |
3630 | 1386 gtk_viewport_set_shadow_type(GTK_VIEWPORT(vp), GTK_SHADOW_NONE); |
3551 | 1387 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); |
1388 | |
3630 | 1389 gtk_container_add(GTK_CONTAINER(vp), plugin_details); |
1390 gtk_container_add(GTK_CONTAINER(sw), vp); | |
3551 | 1391 |
3630 | 1392 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE); |
1393 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE); | |
3551 | 1394 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0); |
1395 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6); | |
1396 gtk_notebook_append_page(GTK_NOTEBOOK(nb), sw, gtk_label_new(_("Details"))); | |
1397 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0); | |
1398 | |
1399 g_signal_connect (G_OBJECT (sel), "changed", | |
1400 G_CALLBACK (prefs_plugin_sel), | |
1401 NULL); | |
1402 g_signal_connect (G_OBJECT(rend), "toggled", | |
1403 G_CALLBACK(plugin_load), ls); | |
1404 | |
1405 path = gtk_tree_path_new_first(); | |
1406 gtk_tree_selection_select_path(sel, path); | |
1407 gtk_tree_path_free(path); | |
1408 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1409 gaim_plugins_register_probe_notify_cb(update_plugin_list, ls); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1410 |
3551 | 1411 gtk_widget_show_all(ret); |
1412 return ret; | |
1413 } | |
1414 | |
3366 | 1415 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data) |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1416 { |
3366 | 1417 GtkTreeModel *model = (GtkTreeModel *)data; |
1418 GtkTreeIter iter; | |
1419 GtkTreePath *path = gtk_tree_path_new_from_string(pth); | |
3500 | 1420 gint soundnum; |
3366 | 1421 |
1422 gtk_tree_model_get_iter (model, &iter, path); | |
1423 gtk_tree_model_get (model, &iter, 2, &soundnum, -1); | |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1424 |
4561 | 1425 sound_options ^= gaim_sound_get_event_option(soundnum); |
1426 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options & gaim_sound_get_event_option(soundnum), -1); | |
3522 | 1427 |
1428 gtk_tree_path_free(path); | |
3366 | 1429 } |
1430 | |
1431 static void test_sound(GtkWidget *button, gpointer i_am_NULL) | |
1432 { | |
1433 guint32 tmp_sound = sound_options; | |
1434 if (!(sound_options & OPT_SOUND_WHEN_AWAY)) | |
1435 sound_options ^= OPT_SOUND_WHEN_AWAY; | |
4561 | 1436 if (!(sound_options & gaim_sound_get_event_option(sound_row_sel))) |
1437 sound_options ^= gaim_sound_get_event_option(sound_row_sel); | |
1438 gaim_sound_play_event(sound_row_sel); | |
3500 | 1439 |
3366 | 1440 sound_options = tmp_sound; |
873
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1441 } |
789df4b47508
[gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
864
diff
changeset
|
1442 |
3366 | 1443 static void reset_sound(GtkWidget *button, gpointer i_am_also_NULL) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1444 { |
3366 | 1445 /* This just resets a sound file back to default */ |
4561 | 1446 gaim_sound_set_event_file(sound_row_sel, NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1447 |
3366 | 1448 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1449 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1450 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1451 void close_sounddialog(GtkWidget *w, GtkWidget *w2) |
1170 | 1452 { |
1453 | |
1454 GtkWidget *dest; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1455 |
1170 | 1456 if (!GTK_IS_WIDGET(w2)) |
1457 dest = w; | |
1458 else | |
1459 dest = w2; | |
1460 | |
1461 sounddialog = NULL; | |
1462 | |
1463 gtk_widget_destroy(dest); | |
1464 } | |
1465 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1466 void do_select_sound(GtkWidget *w, int snd) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1467 { |
1953
f0ff0b367e3d
[gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1930
diff
changeset
|
1468 const char *file; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1469 |
1170 | 1470 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog)); |
1471 | |
1472 /* If they type in a directory, change there */ | |
1473 if (file_is_dir(file, sounddialog)) | |
1474 return; | |
1475 | |
1476 /* Set it -- and forget it */ | |
4561 | 1477 gaim_sound_set_event_file(snd, file); |
3500 | 1478 |
1175 | 1479 /* Set our text entry */ |
4561 | 1480 gtk_entry_set_text(GTK_ENTRY(sound_entry), file); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1481 |
1170 | 1482 /* Close the window! It's getting cold in here! */ |
1483 close_sounddialog(NULL, sounddialog); | |
2471
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1484 |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1485 if (last_sound_dir) |
612efbf62c35
[gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1486 g_free(last_sound_dir); |
4793 | 1487 last_sound_dir = g_path_get_dirname(file); |
1170 | 1488 } |
1489 | |
3366 | 1490 static void sel_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1491 { |
1170 | 1492 char *buf = g_malloc(BUF_LEN); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1493 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1494 if (!sounddialog) { |
4703 | 1495 sounddialog = gtk_file_selection_new(_("Sound Selection")); |
1170 | 1496 |
1497 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog)); | |
1498 | |
3630 | 1499 g_snprintf(buf, BUF_LEN - 1, "%s" G_DIR_SEPARATOR_S, last_sound_dir ? last_sound_dir : gaim_home_dir()); |
1170 | 1500 |
1501 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf); | |
1502 | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1503 g_signal_connect(GTK_OBJECT(sounddialog), "destroy", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1504 G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1505 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1506 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1507 "clicked", G_CALLBACK(do_select_sound), (int *)sound_row_sel); |
1170 | 1508 |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1509 g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button), |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1510 "clicked", G_CALLBACK(close_sounddialog), sounddialog); |
1170 | 1511 } |
1512 | |
1513 g_free(buf); | |
1514 gtk_widget_show(sounddialog); | |
1515 gdk_window_raise(sounddialog->window); | |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1516 } |
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1517 |
3366 | 1518 |
1519 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) { | |
1520 GtkTreeIter iter; | |
1521 GValue val = { 0, }; | |
4561 | 1522 char *file; |
3500 | 1523 |
3366 | 1524 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1525 return; | |
1526 gtk_tree_model_get_value (model, &iter, 2, &val); | |
1527 sound_row_sel = g_value_get_uint(&val); | |
4561 | 1528 file = gaim_sound_get_event_file(sound_row_sel); |
3366 | 1529 if (sound_entry) |
4561 | 1530 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); |
3366 | 1531 g_value_unset (&val); |
1532 if (sounddialog) | |
1533 gtk_widget_destroy(sounddialog); | |
1534 } | |
1535 | |
1536 GtkWidget *sound_events_page() { | |
1537 | |
1538 GtkWidget *ret; | |
1539 GtkWidget *sw; | |
1540 GtkWidget *button, *hbox; | |
1541 GtkTreeIter iter; | |
1542 GtkWidget *event_view; | |
1543 GtkListStore *event_store; | |
1544 GtkCellRenderer *rend; | |
1545 GtkTreeViewColumn *col; | |
1546 GtkTreeSelection *sel; | |
1547 GtkTreePath *path; | |
1548 int j; | |
4561 | 1549 char *file; |
3366 | 1550 |
3427 | 1551 ret = gtk_vbox_new(FALSE, 18); |
1552 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3366 | 1553 |
1554 sw = gtk_scrolled_window_new(NULL,NULL); | |
1555 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | |
3814 | 1556 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1557 | |
3427 | 1558 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3366 | 1559 event_store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_UINT); |
1560 | |
4561 | 1561 for (j=0; j < GAIM_NUM_SOUNDS; j++) { |
1562 guint opt = gaim_sound_get_event_option(j); | |
1563 if (opt == 0) | |
3366 | 1564 continue; |
3500 | 1565 |
3366 | 1566 gtk_list_store_append (event_store, &iter); |
1567 gtk_list_store_set(event_store, &iter, | |
4561 | 1568 0, sound_options & opt, |
1569 1, gettext(gaim_sound_get_event_label(j)), | |
3366 | 1570 2, j, -1); |
1571 } | |
1572 | |
1573 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store)); | |
3500 | 1574 |
3366 | 1575 rend = gtk_cell_renderer_toggle_new(); |
1576 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); | |
1577 g_signal_connect (G_OBJECT (sel), "changed", | |
1578 G_CALLBACK (prefs_sound_sel), | |
1579 NULL); | |
1580 g_signal_connect (G_OBJECT(rend), "toggled", | |
1581 G_CALLBACK(event_toggled), event_store); | |
1582 path = gtk_tree_path_new_first(); | |
1583 gtk_tree_selection_select_path(sel, path); | |
3522 | 1584 gtk_tree_path_free(path); |
3500 | 1585 |
4295 | 1586 col = gtk_tree_view_column_new_with_attributes (_("Play"), |
3366 | 1587 rend, |
1588 "active", 0, | |
1589 NULL); | |
1590 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1591 | |
1592 rend = gtk_cell_renderer_text_new(); | |
4295 | 1593 col = gtk_tree_view_column_new_with_attributes (_("Event"), |
3366 | 1594 rend, |
1595 "text", 1, | |
1596 NULL); | |
1597 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
3500 | 1598 g_object_unref(G_OBJECT(event_store)); |
3366 | 1599 gtk_container_add(GTK_CONTAINER(sw), event_view); |
1600 | |
3427 | 1601 hbox = gtk_hbox_new(FALSE, 6); |
1602 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); | |
3366 | 1603 sound_entry = gtk_entry_new(); |
4561 | 1604 file = gaim_sound_get_event_file(0); |
1605 gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)"); | |
4635 | 1606 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE); |
3366 | 1607 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1608 |
3025 | 1609 button = gtk_button_new_with_label(_("Test")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1610 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL); |
3366 | 1611 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
2759
f26f1d139615
[gaim-migrate @ 2772]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2746
diff
changeset
|
1612 |
1175 | 1613 button = gtk_button_new_with_label(_("Reset")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1614 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL); |
3366 | 1615 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
1175 | 1616 |
1381 | 1617 button = gtk_button_new_with_label(_("Choose...")); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1618 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(sel_sound), NULL); |
3366 | 1619 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1); |
3500 | 1620 |
3427 | 1621 gtk_widget_show_all (ret); |
1006
0a4d0ed65e17
[gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1622 |
3366 | 1623 return ret; |
2580
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1624 } |
86eaeb064e82
[gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2566
diff
changeset
|
1625 |
3366 | 1626 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1627 { |
3366 | 1628 GtkTreeIter iter; |
1629 GValue val = { 0, }; | |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1630 gchar buffer[BUF_LONG]; |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1631 char *tmp; |
3374 | 1632 struct away_message *am; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1633 |
3366 | 1634 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
1635 return; | |
1636 gtk_tree_model_get_value (model, &iter, 1, &val); | |
3374 | 1637 am = g_value_get_pointer(&val); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1638 gtk_imhtml_clear(GTK_IMHTML(away_text)); |
3374 | 1639 strncpy(buffer, am->message, BUF_LONG); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1640 tmp = stylize(buffer, BUF_LONG); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1641 gtk_imhtml_append_text(GTK_IMHTML(away_text), tmp, -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1642 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
2856
b1e300a85678
[gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2843
diff
changeset
|
1643 gtk_imhtml_append_text(GTK_IMHTML(away_text), "<BR>", -1, GTK_IMHTML_NO_TITLE | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
1644 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1645 g_free(tmp); |
3366 | 1646 g_value_unset (&val); |
3500 | 1647 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1648 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1649 |
3500 | 1650 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) { |
3366 | 1651 struct away_message *am; |
1652 GtkTreeIter iter; | |
1653 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv); | |
3379 | 1654 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store); |
3366 | 1655 GValue val = { 0, }; |
3500 | 1656 |
3379 | 1657 if (! gtk_tree_selection_get_selected (sel, &model, &iter)) |
3366 | 1658 return; |
3379 | 1659 gtk_tree_model_get_value (GTK_TREE_MODEL(prefs_away_store), &iter, 1, &val); |
3366 | 1660 am = g_value_get_pointer (&val); |
1661 gtk_imhtml_clear(GTK_IMHTML(away_text)); | |
1662 rem_away_mess(NULL, am); | |
1109
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1663 } |
c73736fa0b7c
[gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1087
diff
changeset
|
1664 |
3366 | 1665 GtkWidget *away_message_page() { |
1666 GtkWidget *ret; | |
3427 | 1667 GtkWidget *hbox; |
3379 | 1668 GtkWidget *button; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1669 GtkWidget *sw; |
3366 | 1670 GtkTreeIter iter; |
1671 GtkWidget *event_view; | |
1672 GtkCellRenderer *rend; | |
1673 GtkTreeViewColumn *col; | |
1674 GtkTreeSelection *sel; | |
940 | 1675 GSList *awy = away_messages; |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1676 struct away_message *a; |
3366 | 1677 GtkWidget *sw2; |
3427 | 1678 GtkSizeGroup *sg; |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1679 |
3427 | 1680 ret = gtk_vbox_new(FALSE, 18); |
1681 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
1682 | |
1683 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); | |
3500 | 1684 |
3366 | 1685 sw = gtk_scrolled_window_new(NULL,NULL); |
1686 away_text = gtk_imhtml_new(NULL, NULL); | |
3427 | 1687 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
3817 | 1688 /* |
1689 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
1690 */ | |
3427 | 1691 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0); |
3500 | 1692 |
3374 | 1693 prefs_away_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); |
3366 | 1694 while (awy) { |
1695 a = (struct away_message *)awy->data; | |
1696 gtk_list_store_append (prefs_away_store, &iter); | |
1697 gtk_list_store_set(prefs_away_store, &iter, | |
3374 | 1698 0, a->name, |
1699 1, a, -1); | |
3366 | 1700 awy = awy->next; |
1701 } | |
1702 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(prefs_away_store)); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1703 |
2906
538c58b43eff
[gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1704 |
3366 | 1705 rend = gtk_cell_renderer_text_new(); |
1706 col = gtk_tree_view_column_new_with_attributes ("NULL", | |
1707 rend, | |
1708 "text", 0, | |
1709 NULL); | |
1710 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col); | |
1711 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(event_view), FALSE); | |
1712 gtk_widget_show(event_view); | |
3427 | 1713 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), event_view); |
3374 | 1714 |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1715 sw2 = gtk_scrolled_window_new(NULL, NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1716 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1717 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); |
3427 | 1718 gtk_box_pack_start(GTK_BOX(ret), sw2, TRUE, TRUE, 0); |
3500 | 1719 |
3427 | 1720 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1721 gaim_setup_imhtml(away_text); |
3366 | 1722 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view)); |
1723 g_signal_connect (G_OBJECT (sel), "changed", | |
1724 G_CALLBACK (away_message_sel), | |
1725 NULL); | |
1726 hbox = gtk_hbox_new(TRUE, 5); | |
3427 | 1727 gtk_box_pack_start(GTK_BOX(ret), hbox, FALSE, FALSE, 0); |
3366 | 1728 button = gtk_button_new_from_stock (GTK_STOCK_ADD); |
1729 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
3427 | 1730 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1731 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), NULL); |
3472 | 1732 |
3366 | 1733 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); |
3427 | 1734 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1735 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(remove_away_message), event_view); |
3472 | 1736 |
3366 | 1737 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3472 | 1738 |
5024 | 1739 button = gaim_pixbuf_button_from_stock(_("_Edit"), GAIM_STOCK_EDIT, GAIM_BUTTON_HORIZONTAL); |
3427 | 1740 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1741 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(create_away_mess), event_view); |
3366 | 1742 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
3500 | 1743 |
3427 | 1744 gtk_widget_show_all(ret); |
3366 | 1745 return ret; |
1746 } | |
3472 | 1747 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1748 GtkTreeIter *prefs_notebook_add_page(const char *text, |
3500 | 1749 GdkPixbuf *pixbuf, |
1750 GtkWidget *page, | |
3366 | 1751 GtkTreeIter *iter, |
3500 | 1752 GtkTreeIter *parent, |
3366 | 1753 int ind) { |
1754 GdkPixbuf *icon = NULL; | |
3500 | 1755 |
3366 | 1756 if (pixbuf) |
3500 | 1757 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1773
diff
changeset
|
1758 |
3366 | 1759 gtk_tree_store_append (prefstree, iter, parent); |
1760 gtk_tree_store_set (prefstree, iter, 0, icon, 1, text, 2, ind, -1); | |
3500 | 1761 |
3366 | 1762 if (pixbuf) |
1763 g_object_unref(pixbuf); | |
1764 if (icon) | |
1765 g_object_unref(icon); | |
1766 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | |
1767 return iter; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1768 } |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1769 |
3366 | 1770 void prefs_notebook_init() { |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1771 GtkTreeIter p, p2, c; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1772 GList *l; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1773 GaimPlugin *plug; |
3565 | 1774 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++); |
4620 | 1775 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c, &p, notebook_page++); |
3565 | 1776 prefs_notebook_add_page(_("Fonts"), NULL, font_page(), &c, &p, notebook_page++); |
1777 prefs_notebook_add_page(_("Message Text"), NULL, messages_page(), &c, &p, notebook_page++); | |
1778 prefs_notebook_add_page(_("Shortcuts"), NULL, hotkeys_page(), &c, &p, notebook_page++); | |
1779 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++); | |
4488 | 1780 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &p2, NULL, notebook_page++); |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1781 prefs_notebook_add_page(_("IMs"), NULL, im_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1782 prefs_notebook_add_page(_("Chats"), NULL, chat_page(), &c, &p2, notebook_page++); |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
1783 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p2, notebook_page++); |
3565 | 1784 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1785 #ifndef _WIN32 |
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1786 /* We use the registered default browser in windows */ |
3565 | 1787 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); |
4461
75ff69e592cc
[gaim-migrate @ 4736]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4451
diff
changeset
|
1788 #endif |
3565 | 1789 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); |
1790 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &p, NULL, notebook_page++); | |
1791 prefs_notebook_add_page(_("Sound Events"), NULL, sound_events_page(), &c, &p, notebook_page++); | |
1792 prefs_notebook_add_page(_("Away / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | |
1793 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1794 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1795 if (gaim_plugins_enabled()) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1796 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1797 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1798 for (l = gaim_plugins_get_loaded(); l != NULL; l = l->next) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1799 plug = l->data; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1800 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1801 if (GAIM_IS_GTK_PLUGIN(plug)) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1802 GtkWidget *config_frame; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1803 GaimGtkPluginUiInfo *ui_info; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1804 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1805 ui_info = GAIM_GTK_PLUGIN_UI_INFO(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1806 config_frame = gaim_gtk_plugin_get_config_frame(plug); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1807 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1808 if (config_frame != NULL) { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1809 ui_info->iter = g_new0(GtkTreeIter, 1); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1810 prefs_notebook_add_page(_(plug->info->name), NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1811 config_frame, ui_info->iter, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1812 &plugin_iter, notebook_page++); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1813 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5105
diff
changeset
|
1814 } |
3565 | 1815 } |
1816 } | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1817 } |
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1818 |
3500 | 1819 void show_prefs() |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1820 { |
3366 | 1821 GtkWidget *vbox, *vbox2; |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1822 GtkWidget *hbox; |
3366 | 1823 GtkWidget *frame; |
1824 GtkTreeViewColumn *column; | |
1825 GtkCellRenderer *cell; | |
1826 GtkTreeSelection *sel; | |
1827 GtkWidget *notebook; | |
1828 GtkWidget *sep; | |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
1829 GtkWidget *button; |
3515 | 1830 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); |
3500 | 1831 |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1832 if (prefs) { |
3472 | 1833 gtk_window_present(GTK_WINDOW(prefs)); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1834 return; |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1835 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1836 |
3366 | 1837 /* copy the preferences to tmp values... |
1838 * I liked "take affect immediately" Oh well :-( */ | |
3818 | 1839 |
1840 /* Back to instant-apply! I win! BU-HAHAHA! */ | |
3500 | 1841 |
3366 | 1842 /* Create the window */ |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1843 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
4074 | 1844 gtk_window_set_role(GTK_WINDOW(prefs), "preferences"); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1845 gtk_widget_realize(prefs); |
4703 | 1846 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences")); |
4635 | 1847 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1848 g_signal_connect(GTK_OBJECT(prefs), "destroy", G_CALLBACK(delete_prefs), NULL); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1849 |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1850 vbox = gtk_vbox_new(FALSE, 5); |
4635 | 1851 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1852 gtk_container_add(GTK_CONTAINER(prefs), vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1853 gtk_widget_show(vbox); |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1854 |
3366 | 1855 hbox = gtk_hbox_new (FALSE, 6); |
1856 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1857 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
1858 gtk_widget_show (hbox); | |
1859 | |
1860 frame = gtk_frame_new (NULL); | |
1861 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1862 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0); | |
1863 gtk_widget_show (frame); | |
3500 | 1864 |
3366 | 1865 /* The tree -- much inspired by the Gimp */ |
1866 prefstree = gtk_tree_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT); | |
1867 tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (prefstree)); | |
1868 gtk_container_add (GTK_CONTAINER (frame), tree_v); | |
1869 | |
1870 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_v), FALSE); | |
1871 gtk_widget_show(tree_v); | |
1872 /* icons */ | |
4892 | 1873 /* XXX: to be used at a later date |
3366 | 1874 cell = gtk_cell_renderer_pixbuf_new (); |
1875 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL); | |
4892 | 1876 */ |
3500 | 1877 |
3366 | 1878 /* text */ |
1879 cell = gtk_cell_renderer_text_new (); | |
1880 column = gtk_tree_view_column_new_with_attributes ("text", cell, "text", 1, NULL); | |
3500 | 1881 |
3366 | 1882 gtk_tree_view_append_column (GTK_TREE_VIEW (tree_v), column); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1883 |
3472 | 1884 /* The right side */ |
1885 frame = gtk_frame_new (NULL); | |
1886 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); | |
1887 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0); | |
1888 gtk_widget_show (frame); | |
3500 | 1889 |
3472 | 1890 vbox2 = gtk_vbox_new (FALSE, 4); |
1891 gtk_container_add (GTK_CONTAINER (frame), vbox2); | |
1892 gtk_widget_show (vbox2); | |
3500 | 1893 |
3472 | 1894 frame = gtk_frame_new (NULL); |
1895 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); | |
1896 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0); | |
1897 gtk_widget_show (frame); | |
3500 | 1898 |
3472 | 1899 hbox = gtk_hbox_new (FALSE, 4); |
1900 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); | |
1901 gtk_container_add (GTK_CONTAINER (frame), hbox); | |
1902 gtk_widget_show (hbox); | |
3500 | 1903 |
3472 | 1904 preflabel = gtk_label_new(NULL); |
1905 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0); | |
1906 gtk_widget_show (preflabel); | |
3500 | 1907 |
3472 | 1908 /* The notebook */ |
1909 prefsnotebook = notebook = gtk_notebook_new (); | |
1910 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); | |
1911 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); | |
1912 gtk_box_pack_start (GTK_BOX (vbox2), notebook, FALSE, FALSE, 0); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1913 |
3472 | 1914 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v)); |
1915 g_signal_connect (G_OBJECT (sel), "changed", | |
1916 G_CALLBACK (pref_nb_select), | |
1917 notebook); | |
3500 | 1918 gtk_widget_show(notebook); |
3472 | 1919 sep = gtk_hseparator_new(); |
1920 gtk_widget_show(sep); | |
1921 gtk_box_pack_start (GTK_BOX (vbox), sep, FALSE, FALSE, 0); | |
3500 | 1922 |
3818 | 1923 /* The buttons^H to press! */ |
3472 | 1924 hbox = gtk_hbox_new (FALSE, 6); |
1925 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6); | |
1926 gtk_container_add (GTK_CONTAINER(vbox), hbox); | |
3500 | 1927 gtk_widget_show (hbox); |
3377 | 1928 |
3818 | 1929 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); |
3515 | 1930 gtk_size_group_add_widget(sg, button); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
1931 g_signal_connect_swapped(GTK_OBJECT(button), "clicked", G_CALLBACK(gtk_widget_destroy), prefs); |
3515 | 1932 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1933 gtk_widget_show(button); | |
1934 | |
3500 | 1935 prefs_notebook_init(); |
3427 | 1936 |
3472 | 1937 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v)); |
1938 gtk_widget_show(prefs); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1939 } |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1940 |
1 | 1941 void set_option(GtkWidget *w, int *option) |
1942 { | |
1943 *option = !(*option); | |
1944 } | |
1945 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1946 static void set_misc_option(GtkWidget *w, int option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
1947 { |
3818 | 1948 misc_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1949 |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1950 if (option == OPT_MISC_DEBUG) { |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1951 if ((misc_options & OPT_MISC_DEBUG)) |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1952 gaim_gtk_debug_window_show(); |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1953 else |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1954 gaim_gtk_debug_window_hide(); |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
1955 } |
4227 | 1956 else if(option == OPT_MISC_USE_SERVER_ALIAS) { |
4687 | 1957 /* XXX blist reset the aliases here */ |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
1958 gaim_conversation_foreach(gaim_conversation_autoset_title); |
4227 | 1959 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1960 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1961 |
3818 | 1962 static void set_logging_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1963 { |
3818 | 1964 logging_options ^= option; |
3500 | 1965 |
3818 | 1966 if (option == OPT_LOG_CONVOS || option == OPT_LOG_CHATS) |
1967 update_log_convs(); | |
3366 | 1968 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1969 |
3818 | 1970 static void set_blist_option(GtkWidget *w, int option) |
3366 | 1971 { |
4695
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1972 struct gaim_gtk_buddy_list *gtkblist; |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1973 |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1974 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); |
4bdd9a5fd026
[gaim-migrate @ 5006]
Christian Hammond <chipx86@chipx86.com>
parents:
4687
diff
changeset
|
1975 |
3818 | 1976 blist_options ^= option; |
5297 | 1977 |
4687 | 1978 if (!gtkblist) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1979 return; |
5297 | 1980 |
1981 if (option == OPT_BLIST_SHOW_WARN) | |
4725 | 1982 gaim_gtk_blist_update_columns(); |
5297 | 1983 else if (option == OPT_BLIST_SHOW_IDLETIME) { |
1984 gaim_gtk_blist_update_refresh_timeout(); | |
1985 gaim_gtk_blist_update_columns(); | |
1986 } | |
4725 | 1987 else if (option == OPT_BLIST_SHOW_ICONS) { |
5297 | 1988 gaim_gtk_blist_update_refresh_timeout(); |
4697 | 1989 gaim_gtk_blist_refresh(gaim_get_blist()); |
4725 | 1990 gaim_gtk_blist_update_columns(); |
1991 } else | |
1992 gaim_gtk_blist_refresh(gaim_get_blist()); | |
5297 | 1993 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1994 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1995 |
3818 | 1996 static void set_convo_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
1997 { |
3818 | 1998 convo_options ^= option; |
3500 | 1999 |
3818 | 2000 if (option == OPT_CONVO_SHOW_SMILEY) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2001 gaim_gtkconv_toggle_smileys(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2002 |
3818 | 2003 if (option == OPT_CONVO_SHOW_TIME) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2004 gaim_gtkconv_toggle_timestamps(); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1411
diff
changeset
|
2005 |
3818 | 2006 if (option == OPT_CONVO_CHECK_SPELLING) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2007 gaim_gtkconv_toggle_spellchk(); |
4445 | 2008 |
2009 if (option == OPT_CONVO_NO_X_ON_TAB) | |
2010 gaim_gtkconv_toggle_close_buttons(); | |
3818 | 2011 } |
2012 | |
2013 static void set_im_option(GtkWidget *w, int option) | |
2014 { | |
2015 im_options ^= option; | |
3500 | 2016 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2017 #if 0 |
3818 | 2018 if (option == OPT_IM_ONE_WINDOW) |
2019 im_tabize(); | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2020 #endif |
3818 | 2021 |
2022 if (option == OPT_IM_HIDE_ICONS) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2023 gaim_gtkconv_hide_buddy_icons(); |
3818 | 2024 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2025 if (option == OPT_IM_ALIAS_TAB) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2026 gaim_conversation_foreach(gaim_conversation_autoset_title); |
2843
87d11d2a7d59
[gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2839
diff
changeset
|
2027 |
3818 | 2028 if (option == OPT_IM_NO_ANIMATION) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2029 gaim_gtkconv_set_anim(); |
1 | 2030 } |
2031 | |
3818 | 2032 static void set_chat_option(GtkWidget *w, int option) |
1 | 2033 { |
3818 | 2034 chat_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2035 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2036 #if 0 |
3818 | 2037 if (option == OPT_CHAT_ONE_WINDOW) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2038 chat_tabize(); |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2039 #endif |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2040 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2041 |
3818 | 2042 void set_sound_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2043 { |
3818 | 2044 sound_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2045 } |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2046 |
3818 | 2047 static void set_font_option(GtkWidget *w, int option) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2048 { |
3818 | 2049 font_options ^= option; |
3500 | 2050 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2051 gaim_gtkconv_update_font_buttons(); |
1 | 2052 } |
2053 | |
3818 | 2054 static void set_away_option(GtkWidget *w, int option) |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2055 { |
3818 | 2056 away_options ^= option; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2057 |
3818 | 2058 if (option == OPT_AWAY_QUEUE) |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2059 toggle_away_queue(); |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2060 } |
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1455
diff
changeset
|
2061 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2062 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |
1 | 2063 { |
2064 GtkWidget *button; | |
3427 | 2065 button = gtk_check_button_new_with_mnemonic(text); |
4635 | 2066 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option)); |
1 | 2067 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); |
4635 | 2068 g_object_set_data(G_OBJECT(button), "options", options); |
1 | 2069 |
4064 | 2070 if (options == &misc_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2071 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_misc_option), |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2282
diff
changeset
|
2072 (int *)option); |
4064 | 2073 } else if (options == &logging_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2074 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_logging_option), |
3818 | 2075 (int *)option); |
4064 | 2076 } else if (options == &blist_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2077 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_blist_option), |
3818 | 2078 (int *)option); |
4064 | 2079 } else if (options == &convo_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2080 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_convo_option), |
3818 | 2081 (int *)option); |
4064 | 2082 } else if (options == &im_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2083 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_im_option), |
3818 | 2084 (int *)option); |
4064 | 2085 } else if (options == &chat_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2086 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_chat_option), |
3818 | 2087 (int *)option); |
4064 | 2088 } else if (options == &font_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2089 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_font_option), |
3818 | 2090 (int *)option); |
4064 | 2091 } else if (options == &sound_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2092 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_sound_option), |
3818 | 2093 (int *)option); |
4064 | 2094 } else if (options == &away_options) { |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2095 g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(set_away_option), |
4064 | 2096 (int *)option); |
2097 } else { | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2098 gaim_debug(GAIM_DEBUG_WARNING, "gaim_button", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2099 "\"%s\" has no signal handler attached to it!\n", text); |
4064 | 2100 } |
1 | 2101 gtk_widget_show(button); |
2102 | |
2103 return button; | |
2104 } | |
2105 | |
3366 | 2106 void default_away_menu_init(GtkWidget *omenu) |
3032 | 2107 { |
3366 | 2108 GtkWidget *menu, *opt; |
2109 int index = 0; | |
2110 GSList *awy = away_messages; | |
2111 struct away_message *a; | |
2112 | |
2113 menu = gtk_menu_new(); | |
2114 | |
2115 while (awy) { | |
2116 a = (struct away_message *)awy->data; | |
2117 opt = gtk_menu_item_new_with_label(a->name); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2118 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(set_default_away), |
3366 | 2119 (gpointer)index); |
2120 gtk_widget_show(opt); | |
4635 | 2121 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); |
3366 | 2122 |
2123 awy = awy->next; | |
2124 index++; | |
2125 } | |
2126 | |
2127 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu)); | |
2128 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu); | |
2129 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), g_slist_index(away_messages, default_away)); | |
2130 } | |
2131 | |
2132 GtkWidget *pref_fg_picture = NULL; | |
2133 GtkWidget *pref_bg_picture = NULL; | |
2134 | |
2135 void destroy_colorsel(GtkWidget *w, gpointer d) | |
2136 { | |
2137 if (d) { | |
2138 gtk_widget_destroy(fgcseld); | |
2139 fgcseld = NULL; | |
2140 } else { | |
2141 gtk_widget_destroy(bgcseld); | |
2142 bgcseld = NULL; | |
2143 } | |
3032 | 2144 } |
2145 | |
3366 | 2146 void apply_color_dlg(GtkWidget *w, gpointer d) |
3032 | 2147 { |
3366 | 2148 if ((int)d == 1) { |
2149 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2150 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel), |
3818 | 2151 &fgcolor); |
3366 | 2152 destroy_colorsel(NULL, (void *)1); |
2153 update_color(NULL, pref_fg_picture); | |
2154 } else { | |
2155 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION | |
3500 | 2156 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel), |
3818 | 2157 &bgcolor); |
3366 | 2158 destroy_colorsel(NULL, (void *)0); |
2159 update_color(NULL, pref_bg_picture); | |
2160 } | |
4421 | 2161 gaim_conversation_foreach(gaim_gtkconv_update_font_colors); |
3032 | 2162 } |
2163 | |
3366 | 2164 void update_color(GtkWidget *w, GtkWidget *pic) |
1 | 2165 { |
3366 | 2166 GdkColor c; |
2167 GtkStyle *style; | |
2168 c.pixel = 0; | |
3500 | 2169 |
3366 | 2170 if (pic == pref_fg_picture) { |
3818 | 2171 if (font_options & OPT_FONT_FGCOL) { |
2172 c.red = fgcolor.red; | |
2173 c.blue = fgcolor.blue; | |
2174 c.green = fgcolor.green; | |
3366 | 2175 } else { |
2176 c.red = 0; | |
2177 c.blue = 0; | |
2178 c.green = 0; | |
2179 } | |
2180 } else { | |
3818 | 2181 if (font_options & OPT_FONT_BGCOL) { |
2182 c.red = bgcolor.red; | |
2183 c.blue = bgcolor.blue; | |
2184 c.green = bgcolor.green; | |
3366 | 2185 } else { |
2186 c.red = 0xffff; | |
2187 c.blue = 0xffff; | |
2188 c.green = 0xffff; | |
2189 } | |
2190 } | |
2191 | |
2192 style = gtk_style_new(); | |
2193 style->bg[0] = c; | |
2194 gtk_widget_set_style(pic, style); | |
4296 | 2195 g_object_unref(style); |
3366 | 2196 } |
4064 | 2197 |
3366 | 2198 void set_default_away(GtkWidget *w, gpointer i) |
2199 { | |
2200 | |
2201 int length = g_slist_length(away_messages); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
2202 |
3366 | 2203 if (away_messages == NULL) |
3818 | 2204 default_away = NULL; |
3366 | 2205 else if ((int)i >= length) |
3818 | 2206 default_away = g_slist_nth_data(away_messages, length - 1); |
3366 | 2207 else |
3818 | 2208 default_away = g_slist_nth_data(away_messages, (int)i); |
3366 | 2209 } |
3500 | 2210 |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
2211 #ifndef _WIN32 |
4428 | 2212 static gboolean program_is_valid(const char *program) |
2213 { | |
2214 GError *error = NULL; | |
2215 char **argv; | |
4869 | 2216 gchar *progname; |
4428 | 2217 gboolean is_valid = FALSE; |
2218 | |
2219 if (program == NULL || *program == '\0') { | |
2220 return FALSE; | |
2221 } | |
2222 | |
2223 if (!g_shell_parse_argv(program, NULL, &argv, &error)) { | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2224 gaim_debug(GAIM_DEBUG_ERROR, "program_is_valid", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2225 "Could not parse program '%s': %s\n", |
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2226 program, error->message); |
4800 | 2227 g_error_free(error); |
4428 | 2228 return FALSE; |
2229 } | |
2230 | |
2231 if (argv == NULL) { | |
2232 return FALSE; | |
2233 } | |
2234 | |
4869 | 2235 progname = g_find_program_in_path(argv[0]); |
2236 is_valid = (progname != NULL); | |
4428 | 2237 |
2238 g_strfreev(argv); | |
4869 | 2239 g_free(progname); |
2240 | |
4428 | 2241 return is_valid; |
2242 } | |
5084
a96653493416
[gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5024
diff
changeset
|
2243 #endif |
4428 | 2244 |
3366 | 2245 static void update_spin_value(GtkWidget *w, GtkWidget *spin) |
2246 { | |
4635 | 2247 int *value = g_object_get_data(G_OBJECT(spin), "val"); |
3366 | 2248 *value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin)); |
2249 } | |
4064 | 2250 |
3427 | 2251 GtkWidget *gaim_labeled_spin_button(GtkWidget *box, const gchar *title, int *val, int min, int max, GtkSizeGroup *sg) |
3366 | 2252 { |
2253 GtkWidget *hbox; | |
2254 GtkWidget *label; | |
2255 GtkWidget *spin; | |
2256 GtkObject *adjust; | |
901
f168f2c7b357
[gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
893
diff
changeset
|
2257 |
3366 | 2258 hbox = gtk_hbox_new(FALSE, 5); |
2259 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
2260 gtk_widget_show(hbox); | |
2261 | |
3427 | 2262 label = gtk_label_new_with_mnemonic(title); |
3366 | 2263 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2264 gtk_widget_show(label); | |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1840
diff
changeset
|
2265 |
3366 | 2266 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1); |
2267 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0); | |
4635 | 2268 g_object_set_data(G_OBJECT(spin), "val", val); |
2269 gtk_widget_set_size_request(spin, 50, -1); | |
3366 | 2270 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2271 g_signal_connect(GTK_OBJECT(adjust), "value-changed", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2272 G_CALLBACK(update_spin_value), GTK_WIDGET(spin)); |
3366 | 2273 gtk_widget_show(spin); |
3500 | 2274 |
3427 | 2275 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin); |
2276 | |
2277 if (sg) { | |
2278 gtk_size_group_add_widget(sg, label); | |
2279 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
3500 | 2280 |
3427 | 2281 } |
2282 return label; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2283 } |
1 | 2284 |
4635 | 2285 void dropdown_set(GObject *w, int *option) |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2286 { |
4635 | 2287 int opt = GPOINTER_TO_INT(g_object_get_data(w, "value")); |
2288 int clear = GPOINTER_TO_INT(g_object_get_data(w, "clear")); | |
3500 | 2289 |
3366 | 2290 if (clear != -1) { |
2291 *option = *option & ~clear; | |
2292 *option = *option | opt; | |
2293 } else { | |
5211
0241d6b6702d
[gaim-migrate @ 5581]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
2294 gaim_debug(GAIM_DEBUG_MISC, "dropdown_set", "HELLO %d\n", opt); |
3366 | 2295 *option = opt; |
2296 } | |
3500 | 2297 |
4634 | 2298 if (option == (int*)&global_proxy_info.proxytype) { |
3366 | 2299 if (opt == PROXY_NONE) |
2300 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE); | |
2301 else | |
2302 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE); | |
3818 | 2303 } else if (option == &web_browser) { |
3366 | 2304 if (opt == BROWSER_MANUAL) |
4428 | 2305 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), TRUE); |
3366 | 2306 else |
4428 | 2307 gtk_widget_set_sensitive(gtk_widget_get_parent(browser_entry), FALSE); |
3818 | 2308 } else if (option == (int*)&sound_options) { |
3366 | 2309 if (opt == OPT_SOUND_CMD) |
2310 gtk_widget_set_sensitive(sndcmd, TRUE); | |
2311 else | |
2312 gtk_widget_set_sensitive(sndcmd, FALSE); | |
4581 | 2313 gaim_sound_change_output_method(); |
4944 | 2314 } else if (option == (int*)&blist_options) { |
2315 gaim_gtk_blist_update_toolbar(); | |
3818 | 2316 } else if (option == (int*)&im_options) { |
2317 if (clear == (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2318 gaim_gtkconv_update_tabs(); |
3818 | 2319 else if (clear == (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2320 gaim_gtkconv_update_im_button_style(); |
3818 | 2321 } else if (option == (int*)&chat_options) { |
2322 if (clear == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB)) | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2323 gaim_gtkconv_update_tabs(); |
3818 | 2324 else if (clear == (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4339
diff
changeset
|
2325 gaim_gtkconv_update_chat_button_style(); |
4687 | 2326 // } else if (option == (int*)&blist_options) { |
2327 // set_blist_tab(); | |
4469
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2328 } else if (option == (int *)&conv_placement_option) { |
d76095396a0e
[gaim-migrate @ 4744]
Christian Hammond <chipx86@chipx86.com>
parents:
4461
diff
changeset
|
2329 gaim_conv_placement_set_active(conv_placement_option); |
3366 | 2330 } |
1 | 2331 } |
2332 | |
3500 | 2333 static GtkWidget *gaim_dropdown(GtkWidget *box, const gchar *title, int *option, int clear, ...) |
1 | 2334 { |
4428 | 2335 va_list ap; |
2336 GList *menuitems = NULL; | |
2337 GtkWidget *dropdown = NULL; | |
2338 char *name; | |
2339 int id; | |
2340 | |
2341 va_start(ap, clear); | |
2342 while ((name = va_arg(ap, char *)) != NULL) { | |
2343 id = va_arg(ap, int); | |
2344 | |
2345 menuitems = g_list_prepend(menuitems, name); | |
2346 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(id)); | |
2347 } | |
2348 va_end(ap); | |
2349 | |
4433 | 2350 g_return_val_if_fail(menuitems != NULL, NULL); |
4428 | 2351 |
2352 menuitems = g_list_reverse(menuitems); | |
2353 | |
2354 dropdown = gaim_dropdown_from_list(box, title, option, clear, menuitems); | |
2355 | |
2356 g_list_free(menuitems); | |
2357 | |
2358 return dropdown; | |
2359 } | |
2360 | |
2361 static GtkWidget *gaim_dropdown_from_list(GtkWidget *box, const gchar *title, int *option, int clear, GList *menuitems) | |
2362 { | |
3366 | 2363 GtkWidget *dropdown, *opt, *menu; |
2364 GtkWidget *label; | |
2365 gchar *text; | |
2366 int value; | |
2367 int o = 0; | |
2368 GtkWidget *hbox; | |
1 | 2369 |
4428 | 2370 g_return_val_if_fail(menuitems != NULL, NULL); |
2371 | |
3366 | 2372 hbox = gtk_hbox_new(FALSE, 5); |
2373 gtk_container_add (GTK_CONTAINER (box), hbox); | |
2374 gtk_widget_show(hbox); | |
2375 | |
3427 | 2376 label = gtk_label_new_with_mnemonic(title); |
3366 | 2377 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
2378 gtk_widget_show(label); | |
2379 | |
2380 dropdown = gtk_option_menu_new(); | |
2381 menu = gtk_menu_new(); | |
3500 | 2382 |
3427 | 2383 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown); |
3500 | 2384 |
4428 | 2385 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { |
2386 menuitems = g_list_next(menuitems); | |
2387 g_return_val_if_fail(menuitems != NULL, NULL); | |
2388 value = GPOINTER_TO_INT(menuitems->data); | |
2389 menuitems = g_list_next(menuitems); | |
2390 | |
3366 | 2391 opt = gtk_menu_item_new_with_label(text); |
4635 | 2392 g_object_set_data(G_OBJECT(opt), "value", GINT_TO_POINTER(value)); |
2393 g_object_set_data(G_OBJECT(opt), "clear", GINT_TO_POINTER(clear)); | |
4162
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2394 g_signal_connect(GTK_OBJECT(opt), "activate", |
d3c8d2b40494
[gaim-migrate @ 4391]
Christian Hammond <chipx86@chipx86.com>
parents:
4137
diff
changeset
|
2395 G_CALLBACK(dropdown_set), (void *)option); |
3366 | 2396 gtk_widget_show(opt); |
2397 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
1 | 2398 |
4994 | 2399 if (((clear > -1) && ((*option & clear) == value)) || *option == value) { |
3366 | 2400 gtk_menu_set_active(GTK_MENU(menu), o); |
2401 } | |
2402 o++; | |
4428 | 2403 |
3366 | 2404 } |
2262
9c8f353331e7
[gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2254
diff
changeset
|
2405 |
3500 | 2406 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); |
3366 | 2407 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0); |
2408 gtk_widget_show(dropdown); | |
3427 | 2409 return label; |
3500 | 2410 } |
2411 | |
3366 | 2412 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc) |
1 | 2413 { |
3366 | 2414 /* more stuff stolen from X-Chat */ |
2415 GtkWidget *swid; | |
2416 GdkColor c; | |
2417 GtkStyle *style; | |
2418 c.pixel = 0; | |
2419 if (fgc) { | |
3818 | 2420 if (font_options & OPT_FONT_FGCOL) { |
2421 c.red = fgcolor.red; | |
2422 c.blue = fgcolor.blue; | |
2423 c.green = fgcolor.green; | |
3366 | 2424 } else { |
2425 c.red = 0; | |
2426 c.blue = 0; | |
2427 c.green = 0; | |
2428 } | |
2429 } else { | |
3818 | 2430 if (font_options & OPT_FONT_BGCOL) { |
2431 c.red = bgcolor.red; | |
2432 c.blue = bgcolor.blue; | |
2433 c.green = bgcolor.green; | |
3366 | 2434 } else { |
2435 c.red = 0xffff; | |
2436 c.blue = 0xffff; | |
2437 c.green = 0xffff; | |
2438 } | |
2439 } | |
1 | 2440 |
3366 | 2441 style = gtk_style_new(); |
2442 style->bg[0] = c; | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
2443 |
3366 | 2444 swid = gtk_event_box_new(); |
2445 gtk_widget_set_style(GTK_WIDGET(swid), style); | |
4296 | 2446 g_object_unref(style); |
4635 | 2447 gtk_widget_set_size_request(GTK_WIDGET(swid), 40, -1); |
3366 | 2448 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5); |
2449 gtk_widget_show(swid); | |
2450 return swid; | |
1 | 2451 } |
4064 | 2452 |
3366 | 2453 void apply_font_dlg(GtkWidget *w, GtkWidget *f) |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2454 { |
3366 | 2455 int i = 0; |
2456 char *fontname; | |
2457 | |
3473 | 2458 fontname = g_strdup(gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(f))); |
3366 | 2459 destroy_fontsel(0, 0); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2460 |
3818 | 2461 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface)) { |
2462 fontface[i] = fontname[i]; | |
3366 | 2463 i++; |
2464 } | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2465 |
3818 | 2466 fontface[i] = 0; |
3366 | 2467 g_free(fontname); |
4635 | 2468 |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4433
diff
changeset
|
2469 gaim_conversation_foreach(gaim_gtkconv_update_font_face); |
1124
a70d5200edde
[gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1123
diff
changeset
|
2470 } |
3500 | 2471 |