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