annotate src/prefs.c @ 5228:1a53330dfd34

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