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