annotate src/prefs.c @ 3722:5ab55c267294

[gaim-migrate @ 3855] allow old (busted) gaim packets to be displayed (paco-paco) committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 16 Oct 2002 23:33:02 +0000
parents f09193608fd3
children d85208a99af2
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"
1357
783ba886b6b6 [gaim-migrate @ 1367]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1324
diff changeset
39 #include "prpl.h"
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
40 #include "proxy.h"
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
41
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
42 /* temporary preferences */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
43 static guint misc_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
44 static guint logging_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
45 static guint blist_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
46 static guint convo_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
47 static guint im_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
48 static guint chat_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
49 static guint font_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
50 static guint sound_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
51 static char *sound_file_new[NUM_SOUNDS];
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
52 static guint away_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
53 static guint away_resend_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
54 static int auto_away_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
55 static int report_idle_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
56 static int proxytype_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
57 static struct away_message* default_away_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
58 static int web_browser_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
59 static char sound_cmd_new[2048];
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
60 static char web_command_new[2048];
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
61 static int fontsize_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
62 GdkColor fgcolor_new, bgcolor_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
63 static struct window_size conv_size_new, buddy_chat_size_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
64 char fontface_new[128];
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
65 char fontface[128];
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
66
3567
ec86e76d0427 [gaim-migrate @ 3663]
Sean Egan <seanegan@gmail.com>
parents: 3565
diff changeset
67 GtkWidget *tree_v = NULL;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
68 GtkWidget *prefs_away_list = NULL;
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1087
diff changeset
69 GtkWidget *prefs_away_menu = NULL;
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
70 GtkWidget *preftree = NULL;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
71 GtkWidget *fontseld = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
72
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
73 GtkListStore *prefs_away_store = NULL;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
74
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
75 static int sound_row_sel = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
76 static char *last_sound_dir = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
77
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
78 static GtkWidget *sounddialog = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
79 static GtkWidget *browser_entry = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
80 static GtkWidget *sound_entry = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
81 static GtkWidget *away_text = NULL;
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
82 GtkCTreeNode *general_node = NULL;
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
83 GtkCTreeNode *deny_node = NULL;
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
84 GtkWidget *prefs_proxy_frame = NULL;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
85 static GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
86 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
87 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
88 static GtkWidget *show_color_pref(GtkWidget *, gboolean);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
89 static void delete_prefs(GtkWidget *, void *);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
90 void set_default_away(GtkWidget *, gpointer);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
91 static void apply_prefs();
1026
5bad25457843 [gaim-migrate @ 1036]
Rob Flynn <gaim@robflynn.com>
parents: 1006
diff changeset
92
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
93 struct debug_window *dw = NULL;
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
94 GtkWidget *prefs = NULL;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
95 GtkWidget *debugbutton = NULL;
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
96 static int notebook_page = 0;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
97 static GtkTreeIter plugin_iter;
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1455
diff changeset
98
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
99 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
100 * PROTOTYPES
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
101 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
102 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
103
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
104 void delete_prefs(GtkWidget *asdf, void *gdsa) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
105 int v;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
106
3485
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
107 prefs = NULL;
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
108 for (v = 0; v < NUM_SOUNDS; v++) {
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
109 if (sound_file_new[v]) {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
110 g_free(sound_file_new[v]);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
111 sound_file_new[v] = NULL;
3485
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
112 }
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
113 }
3567
ec86e76d0427 [gaim-migrate @ 3663]
Sean Egan <seanegan@gmail.com>
parents: 3565
diff changeset
114 tree_v = NULL;
3485
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
115 sound_entry = NULL;
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
116 browser_entry = NULL;
3526
2ce20ac05732 [gaim-migrate @ 3599]
Luke Schierer <lschiere@pidgin.im>
parents: 3522
diff changeset
117 debugbutton = NULL;
2ce20ac05732 [gaim-migrate @ 3599]
Luke Schierer <lschiere@pidgin.im>
parents: 3522
diff changeset
118 prefs_away_menu = NULL;
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
119 notebook_page = 0;
3485
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
120 if(sounddialog)
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
121 gtk_widget_destroy(sounddialog);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
122 g_object_unref(G_OBJECT(prefs_away_store));
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1455
diff changeset
123 }
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1455
diff changeset
124
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
125 GtkWidget *preflabel;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
126 GtkWidget *prefsnotebook;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
127 GtkTreeStore *prefstree;
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1711
diff changeset
128
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
129 static void set_misc_options();
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
130 static void set_logging_options();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
131 static void set_blist_options();
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
132 static void set_convo_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
133 static void set_im_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
134 static void set_chat_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
135 static void set_font_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
136 static void set_sound_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
137 static void set_away_options();
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1711
diff changeset
138
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
139 #define PROXYHOST 0
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
140 #define PROXYPORT 1
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
141 #define PROXYTYPE 2
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
142 #define PROXYUSER 3
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
143 #define PROXYPASS 4
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
144 static void proxy_print_option(GtkEntry *entry, int entrynum)
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
145 {
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2323
diff changeset
146 if (entrynum == PROXYHOST)
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
147 g_snprintf(proxyhost, sizeof(proxyhost), "%s", gtk_entry_get_text(entry));
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
148 else if (entrynum == PROXYPORT)
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
149 proxyport = atoi(gtk_entry_get_text(entry));
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
150 else if (entrynum == PROXYUSER)
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
151 g_snprintf(proxyuser, sizeof(proxyuser), "%s", gtk_entry_get_text(entry));
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
152 else if (entrynum == PROXYPASS)
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
153 g_snprintf(proxypass, sizeof(proxypass), "%s", gtk_entry_get_text(entry));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
154 apply_prefs();
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
155 }
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
156
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
157
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
158 GtkWidget *make_frame(GtkWidget *ret, char *text) {
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
159 GtkWidget *vbox, *label, *hbox;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
160 char labeltext[256];
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
161
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
162 vbox = gtk_vbox_new(FALSE, 6);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
163 gtk_box_pack_start(GTK_BOX(ret), vbox, FALSE, FALSE, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
164 label = gtk_label_new(NULL);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
165 g_snprintf(labeltext, sizeof(labeltext), "<span weight=\"bold\">%s</span>", text);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
166 gtk_label_set_markup(GTK_LABEL(label), labeltext);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
167 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
168 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
169 hbox = gtk_hbox_new(FALSE, 6);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
170 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
171 label = gtk_label_new(" ");
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
172 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
173 vbox = gtk_vbox_new(FALSE, 6);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
174 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
175 return vbox;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
176 }
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
177
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
178 /* OK, Apply and Cancel */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
179
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
180 static void apply_cb(GtkWidget *button, void *data)
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
181 {
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
182 apply_prefs();
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
183 }
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
184
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
185 static void apply_prefs()
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
186 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
187 int r;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
188 if (misc_options != misc_options_new)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
189 set_misc_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
190 if (logging_options != logging_options_new)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
191 set_logging_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
192 if (blist_options != blist_options_new)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
193 set_blist_options();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
194 if (convo_options != convo_options_new)
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
195 set_convo_options();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
196 if (im_options != im_options_new)
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
197 set_im_options();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
198 if (chat_options != chat_options_new)
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
199 set_chat_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
200 chat_options = chat_options_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
201 if (font_options != font_options_new)
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
202 set_font_options();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
203 if (sound_options != sound_options_new)
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
204 set_sound_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
205 for (r = 0; r < NUM_SOUNDS; r++) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
206 if (sound_file[r])
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
207 g_free(sound_file[r]);
3485
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
208 sound_file[r] = g_strdup(sound_file_new[r]);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
209 }
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
210 if (away_options != away_options_new)
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
211 set_away_options();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
212 away_resend = away_resend_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
213 auto_away = auto_away_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
214 report_idle = report_idle_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
215 web_browser = web_browser_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
216 proxytype = proxytype_new;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
217 default_away = default_away_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
218 fontsize = fontsize_new;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
219 #ifndef _WIN32
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
220 g_snprintf(sound_cmd, sizeof(sound_cmd), "%s", sound_cmd_new);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
221 #endif
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
222 g_snprintf(web_command, sizeof(web_command), "%s", web_command_new);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
223 memcpy(&conv_size, &conv_size_new, sizeof(struct window_size));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
224 memcpy(&conv_size, &conv_size_new, sizeof(struct window_size));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
225 memcpy(&fgcolor, &fgcolor_new, sizeof(GdkColor));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
226 memcpy(&bgcolor, &bgcolor_new, sizeof(GdkColor));
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
227
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
228
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
229 g_snprintf(fontface, sizeof(fontface), fontface_new);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
230 update_convo_font();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
231 update_convo_color();
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
232 save_prefs();
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
233 }
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
234
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
235
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
236 static void ok_cb(GtkWidget *button, void *data)
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
237 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
238 apply_cb(button, data);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
239 gtk_widget_destroy(prefs);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
240 }
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
241
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
242 static void pref_nb_select(GtkTreeSelection *sel, GtkNotebook *nb) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
243 GtkTreeIter iter;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
244 char text[128];
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
245 GValue val = { 0, };
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
246 GtkTreeModel *model = GTK_TREE_MODEL(prefstree);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
247
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
248 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
249 return;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
250 gtk_tree_model_get_value (model, &iter, 1, &val);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
251 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
252 g_value_get_string(&val));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
253 gtk_label_set_markup (GTK_LABEL(preflabel), text);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
254 g_value_unset (&val);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
255 gtk_tree_model_get_value (model, &iter, 2, &val);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
256 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
257
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
258 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
259
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
260 /* These are the pages in the preferences notebook */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
261 GtkWidget *interface_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
262 GtkWidget *ret;
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
263 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
264 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
265 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
266
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
267 vbox = make_frame(ret, _("Interface Options"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
268 /* This shouldn't have to wait for user to click OK or APPLY or whatnot */
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
269 /* This really shouldn't be in preferences at all */
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
270 debugbutton = gaim_button(_("Show _Debug Window"), &misc_options_new, OPT_MISC_DEBUG, vbox);
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
271
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
272
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
273 gaim_button(_("Use _borderless buttons"), &misc_options_new, OPT_MISC_COOL_LOOK, vbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
274
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
275 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
276 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
277 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
278
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
279 GtkWidget *font_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
280 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
281 GtkWidget *button;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
282 GtkWidget *vbox, *hbox;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
283 GtkWidget *select = NULL;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
284 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
285
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
286 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
287 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
288
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
289 vbox = make_frame(ret, _("Style"));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
290 gaim_button(_("_Bold"), &font_options_new, OPT_FONT_BOLD, vbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
291 gaim_button(_("_Italics"), &font_options_new, OPT_FONT_ITALIC, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
292 gaim_button(_("_Underline"), &font_options_new, OPT_FONT_UNDERLINE, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
293 gaim_button(_("_Strikethough"), &font_options_new, OPT_FONT_STRIKE, vbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
294
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
295 vbox = make_frame(ret, _("Face"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
296 hbox = gtk_hbox_new(FALSE, 6);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
297 gtk_container_add(GTK_CONTAINER(vbox), hbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
298 button = gaim_button(_("Use custo_m face"), &font_options_new, OPT_FONT_FACE, hbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
299 gtk_size_group_add_widget(sg, button);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
300 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_FONT);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
301
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
302 if (!(font_options_new & OPT_FONT_FACE))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
303 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
304 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
305 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
306 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
307
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
308 hbox = gtk_hbox_new(FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
309 gtk_container_add(GTK_CONTAINER(vbox), hbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
310 button = gaim_button(_("Use custom si_ze"), &font_options_new, OPT_FONT_SIZE, hbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
311 gtk_size_group_add_widget(sg, button);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
312 select = gaim_labeled_spin_button(hbox, NULL, &fontsize_new, 1, 7, NULL);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
313 if (!(font_options_new & OPT_FONT_SIZE))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
314 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
315 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
316
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
317 vbox = make_frame(ret, _("Color"));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
318 hbox = gtk_hbox_new(FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
319 gtk_container_add(GTK_CONTAINER(vbox), hbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
320
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
321
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
322 button = gaim_button(_("_Text color"), &font_options_new, OPT_FONT_FGCOL, hbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
323 gtk_size_group_add_widget(sg, button);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
324
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
325 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
326 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
327 pref_fg_picture = show_color_pref(hbox, TRUE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
328 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color),
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
329 pref_fg_picture);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
330
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
331 if (!(font_options_new & OPT_FONT_FGCOL))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
332 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
333 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
334 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_fgcolor_dialog), NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
335 hbox = gtk_hbox_new(FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
336 gtk_container_add(GTK_CONTAINER(vbox), hbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
337
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
338 button = gaim_button(_("Bac_kground color"), &font_options_new, OPT_FONT_BGCOL, hbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
339 gtk_size_group_add_widget(sg, button);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
340 select = gtk_button_new_from_stock(GTK_STOCK_SELECT_COLOR);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
341 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
342 pref_bg_picture = show_color_pref(hbox, FALSE);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
343 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color),
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
344 pref_bg_picture);
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
345
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
346 if (!(font_options_new & OPT_FONT_BGCOL))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
347 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
348 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_bgcolor_dialog), NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
349 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
350
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
351 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
352 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
353 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
354
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
355
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
356 GtkWidget *messages_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
357 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
358 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
359 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
360 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
361
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
362 vbox = make_frame (ret, _("Display"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
363 gaim_button(_("Show graphical _smileys"), &convo_options_new, OPT_CONVO_SHOW_SMILEY, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
364 gaim_button(_("Show _timestamp on messages"), &convo_options_new, OPT_CONVO_SHOW_TIME, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
365 gaim_button(_("Show _URLs as links"), &convo_options_new, OPT_CONVO_SEND_LINKS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
366 gaim_button(_("_Highlight misspelled words"), &convo_options_new, OPT_CONVO_CHECK_SPELLING, vbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
367
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
368 vbox = make_frame (ret, _("Ignore"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
369 gaim_button(_("Ignore c_olors"), &convo_options_new, OPT_CONVO_IGNORE_COLOUR, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
370 gaim_button(_("Ignore font _faces"), &convo_options_new, OPT_CONVO_IGNORE_FONTS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
371 gaim_button(_("Ignore font si_zes"), &convo_options_new, OPT_CONVO_IGNORE_SIZES, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
372 gaim_button(_("Ignore Ti_K Automated Messages"), &away_options_new, OPT_AWAY_TIK_HACK, vbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
373
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
374 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
375 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
376 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
377
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
378 GtkWidget *hotkeys_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
379 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
380 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
381 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
382 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
383
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
384 vbox = make_frame(ret, _("Send Message"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
385 gaim_button(_("_Enter sends message"), &convo_options_new, OPT_CONVO_ENTER_SENDS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
386 gaim_button(_("C_ontrol-Enter sends message"), &convo_options_new, OPT_CONVO_CTL_ENTER, vbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
387
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
388 vbox = make_frame (ret, _("Window Closing"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
389 gaim_button(_("E_scape closes window"), &convo_options_new, OPT_CONVO_ESC_CAN_CLOSE, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
390 gaim_button(_("Control-_W closes window"), &convo_options_new, OPT_CONVO_CTL_W_CLOSES, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
391
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
392 vbox = make_frame(ret, "Insertions");
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
393 gaim_button(_("Control-{B/I/U/S} inserts _HTML tags"), &convo_options_new, OPT_CONVO_CTL_CHARS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
394 gaim_button(_("Control-(number) inserts _smileys"), &convo_options_new, OPT_CONVO_CTL_SMILEYS, vbox);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
395
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
396 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
397 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
398 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
399
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
400 GtkWidget *list_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
401 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
402 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
403 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
404 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
405
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
406 /* fixme: docklet
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
407 gaim_button(_("Automatically show buddy list on sign on"), &blist_options_new,
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
408 OPT_BLIST_APP_BUDDY_SHOW, vbox);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
409 gaim_button(_("Display Buddy List near applet"), &blist_options_new, OPT_BLIST_NEAR_APPLET, vbox); */
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
410
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
411 vbox = make_frame (ret, _("Buttons"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
412 gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options_new, OPT_BLIST_NO_BUTTONS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
413 gaim_button(_("Show _pictures on buttons"), &blist_options_new, OPT_BLIST_SHOW_BUTTON_XPM, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
414
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
415 vbox = make_frame (ret, _("Buddy List Window"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
416 gaim_button(_("_Save Window Size/Position"), &blist_options_new, OPT_BLIST_SAVED_WINDOWS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
417 gaim_button(_("_Raise Window on Events"), &blist_options_new, OPT_BLIST_POPUP, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
418
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
419 vbox = make_frame (ret, _("Group Display"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
420 gaim_button(_("Hide _groups with no online buddies"), &blist_options_new, OPT_BLIST_NO_MT_GRP, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
421 gaim_button(_("Show _numbers in groups"), &blist_options_new, OPT_BLIST_SHOW_GRPNUM, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
422
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
423 vbox = make_frame (ret, _("Buddy Display"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
424 gaim_button(_("Show buddy type _icons"), &blist_options_new, OPT_BLIST_SHOW_PIXMAPS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
425 gaim_button(_("Show _warning levels"), &blist_options_new, OPT_BLIST_SHOW_WARN, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
426 gaim_button(_("Show idle _times"), &blist_options_new, OPT_BLIST_SHOW_IDLETIME, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
427 gaim_button(_("Grey i_dle buddies"), &blist_options_new, OPT_BLIST_GREY_IDLERS, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
428
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
429 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
430 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
431 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
432
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
433 GtkWidget *im_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
434 GtkWidget *ret;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
435 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
436 GtkWidget *typingbutton, *widge;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
437 GtkSizeGroup *sg;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
438
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
439 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
440 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
441
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
442 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
443
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
444 vbox = make_frame (ret, _("Window"));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
445 widge = gaim_dropdown(vbox, "Show _buttons as:", &im_options_new, OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM,
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
446 "Pictures", OPT_IM_BUTTON_XPM,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
447 "Text", OPT_IM_BUTTON_TEXT,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
448 "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
449 gtk_size_group_add_widget(sg, widge);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
450 gtk_misc_set_alignment(GTK_MISC(widge), 0, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
451 gaim_labeled_spin_button(vbox, _("New window _width:"), &conv_size_new.width, 25, 9999, sg);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
452 gaim_labeled_spin_button(vbox, _("New window _height:"), &conv_size_new.height, 25, 9999, sg);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
453 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &conv_size_new.entry_height, 25, 9999, sg);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
454 gaim_button(_("_Raise windows on events"), &im_options_new, OPT_IM_POPUP, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
455 gaim_button(_("Hide window on _send"), &im_options_new, OPT_IM_POPDOWN, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
456 gtk_widget_show (vbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
457
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
458 vbox = make_frame (ret, _("Buddy Icons"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
459 gaim_button(_("Hide Buddy _Icons"), &im_options_new, OPT_IM_HIDE_ICONS, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
460 gaim_button(_("Disable Buddy Icon A_nimation"), &im_options_new, OPT_IM_NO_ANIMATION, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
461
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
462 vbox = make_frame (ret, _("Display"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
463 gaim_button(_("Show _logins in window"), &im_options_new, OPT_IM_LOGON, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
464
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
465 vbox = make_frame (ret, _("Typing Notification"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
466 typingbutton = gaim_button(_("Notify buddies that you are _typing to them"), &misc_options_new,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
467 OPT_MISC_STEALTH_TYPING, vbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
468 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(typingbutton), !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(typingbutton)));
3404
a84c5f21e630 [gaim-migrate @ 3423]
Sean Egan <seanegan@gmail.com>
parents: 3401
diff changeset
469 misc_options_new ^= OPT_MISC_STEALTH_TYPING;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
470
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
471 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
472 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
473 }
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 GtkWidget *chat_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
476 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
477 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
478 GtkWidget *dd;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
479 GtkSizeGroup *sg;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
480
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
481 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
482 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
483
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
484 sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
485
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
486 vbox = make_frame (ret, _("Window"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
487 dd = gaim_dropdown(vbox, "Show _buttons as:", &chat_options_new, OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM,
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
488 "Pictures", OPT_CHAT_BUTTON_XPM,
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
489 "Text", OPT_CHAT_BUTTON_TEXT,
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
490 "Pictures and Text", OPT_CHAT_BUTTON_XPM | OPT_CHAT_BUTTON_TEXT, NULL);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
491 gtk_size_group_add_widget(sg, dd);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
492 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
493 gaim_labeled_spin_button(vbox, _("New window _width:"), &buddy_chat_size_new.width, 25, 9999, sg);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
494 gaim_labeled_spin_button(vbox, _("New window _height:"), &buddy_chat_size_new.height, 25, 9999, sg);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
495 gaim_labeled_spin_button(vbox, _("_Entry widget height:"), &buddy_chat_size_new.entry_height, 25, 9999, sg);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
496 gaim_button(_("_Raise windows on events"), &chat_options_new, OPT_CHAT_POPUP, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
497
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
498 vbox = make_frame (ret, _("Tab Completion"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
499 gaim_button(_("_Tab-Complete Nicks"), &chat_options_new, OPT_CHAT_TAB_COMPLETE, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
500 gaim_button(_("_Old-Style Tab Completion"), &chat_options_new, OPT_CHAT_OLD_STYLE_TAB, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
501
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
502 vbox = make_frame (ret, _("Display"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
503 gaim_button(_("_Show people joining/leaving in window"), &chat_options_new, OPT_CHAT_LOGON, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
504 gaim_button(_("Co_lorize screennames"), &chat_options_new, OPT_CHAT_COLORIZE, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
505
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
506 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
507 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
508 }
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
509
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
510 GtkWidget *tab_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
511 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
512 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
513 GtkWidget *dd;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
514 GtkSizeGroup *sg;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
515 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
516 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
517
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
518 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
519
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
520 vbox = make_frame (ret, _("IM Tabs"));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
521 dd = gaim_dropdown(vbox, "Tab _Placement:", &im_options_new, OPT_IM_SIDE_TAB | OPT_IM_BR_TAB,
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
522 "Top", 0,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
523 "Bottom", OPT_IM_BR_TAB,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
524 "Left", OPT_IM_SIDE_TAB,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
525 "Right", OPT_IM_BR_TAB | OPT_IM_SIDE_TAB, NULL);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
526 gtk_size_group_add_widget(sg, dd);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
527 gaim_button(_("Show all _Instant Messages in one tabbed\nwindow"), &im_options_new, OPT_IM_ONE_WINDOW, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
528 gaim_button(_("Show a_liases in tabs/titles"), &im_options_new, OPT_IM_ALIAS_TAB, vbox);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
529
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
530 vbox = make_frame (ret, _("Chat Tabs"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
531 dd = gaim_dropdown(vbox, "Tab _Placement:", &chat_options_new, OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB,
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
532 "Top", 0,
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
533 "Bottom", OPT_CHAT_BR_TAB,
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
534 "Left", OPT_CHAT_SIDE_TAB,
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
535 "Right", OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB, NULL);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
536 gtk_size_group_add_widget(sg, dd);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
537 gaim_button(_("Show all c_hats in one tabbed window"), &chat_options_new, OPT_CHAT_ONE_WINDOW,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
538 vbox);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
539
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
540 vbox = make_frame (ret, _("Combined Tabs"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
541 gaim_button(_("Show IMs and chats in _same tabbed\nwindow."), &convo_options_new, OPT_CONVO_COMBINE, vbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
542
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
543 vbox = make_frame (ret, _("Buddy List Tabs"));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
544 dd = gaim_dropdown(vbox, "Tab _Placement:", &blist_options_new, OPT_BLIST_BOTTOM_TAB,
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
545 "Top", 0,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
546 "Bottom", OPT_BLIST_BOTTOM_TAB, NULL);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
547 gtk_size_group_add_widget(sg, dd);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
548
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
549 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
550 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
551 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
552
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
553 GtkWidget *proxy_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
554 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
555 GtkWidget *vbox;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
556 GtkWidget *entry;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
557 GtkWidget *label;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
558 GtkWidget *hbox;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
559 GtkWidget *table;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
560
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
561 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
562 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
563
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
564 vbox = make_frame (ret, _("Proxy Type"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
565 gaim_dropdown(vbox, "Proxy _Type:", &proxytype_new, -1,
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
566 "No Proxy", PROXY_NONE,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
567 "SOCKS 4", PROXY_SOCKS4,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
568 "SOCKS 5", PROXY_SOCKS5,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
569 "HTTP", PROXY_HTTP, NULL);
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2323
diff changeset
570
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
571 table = gtk_table_new(2, 2, FALSE);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
572 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
573 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
574 gtk_table_set_row_spacings(GTK_TABLE(table), 5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
575
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
576 vbox = make_frame(ret, _("Proxy Server"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
577 prefs_proxy_frame = vbox;
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
578
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
579 if (proxytype == PROXY_NONE)
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
580 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE);
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
581
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
582 table = gtk_table_new(2, 4, FALSE);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
583 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
584 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
585 gtk_table_set_row_spacings(GTK_TABLE(table), 10);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
586 gtk_container_add(GTK_CONTAINER(vbox), table);
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
587
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
588
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
589 label = gtk_label_new_with_mnemonic(_("_Host"));
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
590 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
591 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
592
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
593 entry = gtk_entry_new();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
594 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
595 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
596 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2323
diff changeset
597 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYHOST);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
598 gtk_entry_set_text(GTK_ENTRY(entry), proxyhost);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
599
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
600 hbox = gtk_hbox_new(TRUE, 5);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
601 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
602
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
603 label = gtk_label_new_with_mnemonic(_("Port"));
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
604 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
605 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
606
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
607 entry = gtk_entry_new();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
608 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
609 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
610 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2323
diff changeset
611 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPORT);
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
612
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
613 if (proxyport) {
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
614 char buf[128];
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
615 g_snprintf(buf, sizeof(buf), "%d", proxyport);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
616 gtk_entry_set_text(GTK_ENTRY(entry), buf);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
617 }
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
618
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
619 label = gtk_label_new_with_mnemonic(_("_User"));
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
620 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
621 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
622
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
623 entry = gtk_entry_new();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
624 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
625 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
626 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2323
diff changeset
627 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYUSER);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
628 gtk_entry_set_text(GTK_ENTRY(entry), proxyuser);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
629
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
630 hbox = gtk_hbox_new(TRUE, 5);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
631 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
632
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
633 label = gtk_label_new_with_mnemonic(_("Pa_ssword"));
2254
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
634 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
c0ac78ffe77f [gaim-migrate @ 2264]
Rob Flynn <gaim@robflynn.com>
parents: 2199
diff changeset
635 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
636
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
637 entry = gtk_entry_new();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
638 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
639 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
640 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
641 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2372
2927c2c26fe6 [gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2323
diff changeset
642 GTK_SIGNAL_FUNC(proxy_print_option), (void *)PROXYPASS);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
643 gtk_entry_set_text(GTK_ENTRY(entry), proxypass);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
644
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
645 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
646 return ret;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
647 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
648
3432
d40f96a0169b [gaim-migrate @ 3459]
Sean Egan <seanegan@gmail.com>
parents: 3429
diff changeset
649 static void browser_print_option(GtkEntry *entry, void *nullish) {
d40f96a0169b [gaim-migrate @ 3459]
Sean Egan <seanegan@gmail.com>
parents: 3429
diff changeset
650 g_snprintf(web_command_new, sizeof(web_command_new), "%s", gtk_entry_get_text(entry));
d40f96a0169b [gaim-migrate @ 3459]
Sean Egan <seanegan@gmail.com>
parents: 3429
diff changeset
651 }
d40f96a0169b [gaim-migrate @ 3459]
Sean Egan <seanegan@gmail.com>
parents: 3429
diff changeset
652
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
653 GtkWidget *browser_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
654 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
655 GtkWidget *vbox, *hbox;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
656 GtkWidget *label;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
657 GtkSizeGroup *sg;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
658
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
659 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
660 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
661
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
662 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
663 #ifndef _WIN32
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
664 /* Registered default browser is used by Windows */
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
665 vbox = make_frame (ret, _("Browser Selection"));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
666 label = gaim_dropdown(vbox, "_Browser", &web_browser_new, -1,
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
667 "Netscape", BROWSER_NETSCAPE,
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
668 "Konqueror", BROWSER_KONQ,
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
669 "Mozilla", BROWSER_MOZILLA,
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
670 "Manual", BROWSER_MANUAL,
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
671 /* fixme: GNOME binary helper
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
672 "GNOME URL Handler", BROWSER_GNOME, */
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
673 "Galeon", BROWSER_GALEON,
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
674 "Opera", BROWSER_OPERA, NULL);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
675 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
676 gtk_size_group_add_widget(sg, label);
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
677
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
678 hbox = gtk_hbox_new(FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
679 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
680 label = gtk_label_new_with_mnemonic("_Manual: ");
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
681 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
682 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
683 gtk_size_group_add_widget(sg, label);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
684 browser_entry = gtk_entry_new();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
685 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
686 if (web_browser_new != BROWSER_MANUAL)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
687 gtk_widget_set_sensitive(browser_entry, FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
688 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
689
3432
d40f96a0169b [gaim-migrate @ 3459]
Sean Egan <seanegan@gmail.com>
parents: 3429
diff changeset
690 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command_new);
d40f96a0169b [gaim-migrate @ 3459]
Sean Egan <seanegan@gmail.com>
parents: 3429
diff changeset
691 gtk_signal_connect(GTK_OBJECT(browser_entry), "changed",
d40f96a0169b [gaim-migrate @ 3459]
Sean Egan <seanegan@gmail.com>
parents: 3429
diff changeset
692 GTK_SIGNAL_FUNC(browser_print_option), NULL);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
693 #endif /* end !_WIN32 */
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
694 vbox = make_frame (ret, _("Browser Options"));
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
695 label = gaim_button(_("Open new _window by default"), &misc_options_new, OPT_MISC_BROWSER_POPUP, vbox);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
696 #ifdef _WIN32
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
697 /* Until I figure out how to implement this on windows */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
698 gtk_widget_set_sensitive(label, FALSE);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
699 #endif
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
700 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
701 return ret;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
702 }
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
703
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
704 GtkWidget *logging_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
705 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
706 GtkWidget *vbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
707 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
708 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
709
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
710 vbox = make_frame (ret, _("Message Logs"));
3457
222e23f91092 [gaim-migrate @ 3505]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
711 gaim_button(_("_Log all Instant Messages"), &logging_options_new, OPT_LOG_CONVOS, vbox);
222e23f91092 [gaim-migrate @ 3505]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
712 gaim_button(_("Log all c_hats"), &logging_options_new, OPT_LOG_CHATS, vbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
713 gaim_button(_("Strip _HTML from logs"), &logging_options_new, OPT_LOG_STRIP_HTML, vbox);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2839
diff changeset
714
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
715 vbox = make_frame (ret, _("System Logs"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
716 gaim_button(_("Log when buddies _sign on/sign off"), &logging_options_new, OPT_LOG_BUDDY_SIGNON,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
717 vbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
718 gaim_button(_("Log when buddies become _idle/un-idle"), &logging_options_new, OPT_LOG_BUDDY_IDLE,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
719 vbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
720 gaim_button(_("Log when buddies go away/come _back"), &logging_options_new, OPT_LOG_BUDDY_AWAY, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
721 gaim_button(_("Log your _own signons/idleness/awayness"), &logging_options_new, OPT_LOG_MY_SIGNON,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
722 vbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
723 gaim_button(_("I_ndividual log file for each buddy's signons"), &logging_options_new,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
724 OPT_LOG_INDIVIDUAL, vbox);
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1755
diff changeset
725
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
726 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
727 return ret;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1755
diff changeset
728 }
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1755
diff changeset
729
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
730 static GtkWidget *sndcmd = NULL;
1757
3dfe4aefd366 [gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1755
diff changeset
731
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
732 static gint sound_cmd_yeah(GtkEntry *entry, GdkEvent *event, gpointer d)
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
733 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
734 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", gtk_entry_get_text(GTK_ENTRY(sndcmd)));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
735 return TRUE;
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
736 }
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
737
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
738 GtkWidget *sound_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
739 GtkWidget *ret;
1750
d2eca7a46cfd [gaim-migrate @ 1760]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1711
diff changeset
740 GtkWidget *label;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
741 GtkWidget *vbox, *hbox;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
742 GtkSizeGroup *sg;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
743 GtkWidget *dd;
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 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
746 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
747
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
748 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
749
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
750 vbox = make_frame (ret, _("Sound Options"));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
751 gaim_button(_("_No sounds when you log in"), &sound_options_new, OPT_SOUND_SILENT_SIGNON, vbox);
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
752 gaim_button(_("_Sounds while away"), &sound_options_new, OPT_SOUND_WHEN_AWAY, vbox);
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2839
diff changeset
753
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
754 #ifndef _WIN32
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
755 vbox = make_frame (ret, _("Sound Method"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
756 dd = gaim_dropdown(vbox, "_Method", &sound_options_new, OPT_SOUND_BEEP |
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
757 OPT_SOUND_ESD | OPT_SOUND_ARTSC | OPT_SOUND_NAS | OPT_SOUND_NORMAL |
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
758 OPT_SOUND_CMD,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
759 "Console Beep", OPT_SOUND_BEEP,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
760 #ifdef ESD_SOUND
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
761 "ESD", OPT_SOUND_ESD,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
762 #endif /* ESD_SOUND */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
763 #ifdef ARTSC_SOUND
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
764 "ArtsC", OPT_SOUND_ARTSC,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
765 #endif /* ARTSC_SOUND */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
766 #ifdef NAS_SOUND
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
767 "NAS", OPT_SOUND_NAS,
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
768 #endif /* NAS_SOUND */
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
769 "Internal", OPT_SOUND_NORMAL,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
770 "Command", OPT_SOUND_CMD, NULL);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
771 gtk_size_group_add_widget(sg, dd);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
772 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
773
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
774 hbox = gtk_hbox_new(FALSE, 5);
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
775 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
776
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
777 hbox = gtk_hbox_new(FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
778 gtk_container_add(GTK_CONTAINER(vbox), hbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
779 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
780 gtk_size_group_add_widget(sg, label);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
781 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
782 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
783
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
784 sndcmd = gtk_entry_new();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
785 gtk_label_set_mnemonic_widget(GTK_LABEL(label), sndcmd);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
786
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
787 gtk_entry_set_editable(GTK_ENTRY(sndcmd), TRUE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
788 gtk_entry_set_text(GTK_ENTRY(sndcmd), sound_cmd);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
789 gtk_widget_set_size_request(sndcmd, 75, -1);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
790
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
791 gtk_widget_set_sensitive(sndcmd, (sound_options_new & OPT_SOUND_CMD));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
792 gtk_box_pack_start(GTK_BOX(hbox), sndcmd, TRUE, TRUE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
793 gtk_signal_connect(GTK_OBJECT(sndcmd), "focus_out_event", GTK_SIGNAL_FUNC(sound_cmd_yeah), NULL);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
794 #endif /* _WIN32 */
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
795 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
796 return ret;
2262
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
797 }
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
798
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
799 GtkWidget *away_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
800 GtkWidget *ret;
2262
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
801 GtkWidget *vbox;
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
802 GtkWidget *hbox;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
803 GtkWidget *label;
2262
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
804 GtkWidget *button;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
805 GtkWidget *select;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
806 GtkWidget *dd;
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
807 GtkSizeGroup *sg;
2262
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
808
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
809 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
810 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
2262
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
811
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
812 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
813
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
814 vbox = make_frame (ret, _("Away"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
815 gaim_button(_("_Sending messages removes away status"), &away_options_new, OPT_AWAY_BACK_ON_IM, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
816 gaim_button(_("_Queue new messages when away"), &away_options_new, OPT_AWAY_QUEUE, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
817 gaim_button(_("_Ignore new conversations when away"), &away_options_new, OPT_AWAY_DISCARD, vbox);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
818
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
819 vbox = make_frame (ret, _("Auto-response"));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
820 hbox = gtk_hbox_new(FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
821 gtk_container_add(GTK_CONTAINER(vbox), hbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
822 gaim_labeled_spin_button(hbox, _("Seconds before _resending:"),
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
823 &away_resend_new, 1, 24 * 60 * 60, sg);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
824 gaim_button(_("_Don't send auto-response"), &away_options_new, OPT_AWAY_NO_AUTO_RESP, vbox);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
825 gaim_button(_("_Only send auto-response when idle"), &away_options_new, OPT_AWAY_IDLE_RESP, vbox);
1813
998a6a032874 [gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1805
diff changeset
826
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
827 if (away_options_new & OPT_AWAY_NO_AUTO_RESP)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
828 gtk_widget_set_sensitive(hbox, FALSE);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
829
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
830 vbox = make_frame (ret, _("Idle"));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
831 dd = gaim_dropdown(vbox, "Idle _Time Reporting:", &report_idle_new, -1,
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
832 "None", IDLE_NONE,
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
833 "Gaim Usage", IDLE_GAIM,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
834 #ifdef USE_SCREENSAVER
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
835 "X Usage", IDLE_SCREENSAVER,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
836 #endif
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
837 NULL);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
838 gtk_size_group_add_widget(sg, dd);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
839 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0);
2385
bdc74764245c [gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2372
diff changeset
840
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
841 vbox = make_frame (ret, _("Auto-away"));
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
842 button = gaim_button(_("Set away _when idle"), &away_options_new, OPT_AWAY_AUTO, vbox);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
843 select = gaim_labeled_spin_button(vbox, "_Minutes before setting away:", &auto_away_new, 1, 24 * 60, sg);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
844 if (!(away_options_new & OPT_AWAY_AUTO))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
845 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
846 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
847
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
848 label = gtk_label_new_with_mnemonic("Away m_essage:");
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
849 gtk_size_group_add_widget(sg, label);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
850 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
851 hbox = gtk_hbox_new(FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
852 gtk_container_add(GTK_CONTAINER(vbox), hbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
853 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
854 prefs_away_menu = gtk_option_menu_new();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
855 gtk_label_set_mnemonic_widget(GTK_LABEL(label), prefs_away_menu);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
856 if (!(away_options_new & OPT_AWAY_AUTO))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
857 gtk_widget_set_sensitive(GTK_WIDGET(prefs_away_menu), FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
858 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), prefs_away_menu);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
859 default_away_menu_init(prefs_away_menu);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
860 gtk_widget_show(prefs_away_menu);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
861 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
862
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
863 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
864 return ret;
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
865 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
866
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
867 #if USE_PLUGINS
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
868 GtkWidget *plugin_description=NULL, *plugin_details=NULL;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
869 static void prefs_plugin_sel (GtkTreeSelection *sel, GtkTreeModel *model)
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
870 {
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
871 gchar buf[1024];
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
872 GtkTreeIter iter;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
873 GValue val = { 0, };
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
874 struct gaim_plugin *plug;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
875
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
876 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
877 return;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
878 gtk_tree_model_get_value (model, &iter, 2, &val);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
879 plug = g_value_get_pointer(&val);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
880
3563
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
881 if (plug->error[0])
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
882 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n"
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
883 "<span weight=\"bold\" color=\"red\">%s</span>\n\n"
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
884 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description);
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
885 else
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
886 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n"
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
887 "%s"), plug->desc.name, plug->desc.version, plug->desc.description);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
888 gtk_label_set_markup(GTK_LABEL(plugin_description), buf);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
889 g_snprintf(buf, sizeof(buf),
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
890 #ifndef _WIN32
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
891 _("<span size=\"larger\">%s %s</span>\n\n"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
892 "<span weight=\"bold\">Written by:</span>\t%s\n"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
893 "<span weight=\"bold\">URL:</span>\t%s\n"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
894 "<span weight=\"bold\">File name:</span>\t%s"),
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
895 #else
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
896 _("<span size=\"larger\">%s %s</span>\n\n"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
897 "<span weight=\"bold\">Written by:</span> %s\n"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
898 "<span weight=\"bold\">URL:</span> %s\n"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
899 "<span weight=\"bold\">File name:</span> %s"),
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
900 #endif
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
901 plug->desc.name, plug->desc.version, plug->desc.authors, plug->desc.url, plug->path);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
902 gtk_label_set_markup(GTK_LABEL(plugin_details), buf);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
903 g_value_unset (&val);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
904 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
905
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
906 static void plugin_load (GtkCellRendererToggle *cell, gchar *pth, gpointer data)
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
907 {
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
908 GtkTreeModel *model = (GtkTreeModel *)data;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
909 GtkTreeIter iter;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
910 GtkTreePath *path = gtk_tree_path_new_from_string(pth);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
911 struct gaim_plugin *plug;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
912 gchar buf[1024];
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
913 GtkWidget *(*config)();
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
914
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
915 GdkCursor *wait = gdk_cursor_new (GDK_WATCH);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
916 gdk_window_set_cursor(prefs->window, wait);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
917 gdk_cursor_unref(wait);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
918
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
919 gtk_tree_model_get_iter (model, &iter, path);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
920 gtk_tree_model_get (model, &iter, 2, &plug, -1);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
921
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
922 if (!plug->handle)
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
923
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
924 if (plug->type == plugin)
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
925 #ifdef GAIM_PLUGINS
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
926 {
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
927 load_plugin(plug->path);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
928 if (g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) {
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
929 plug->iter = g_new0(GtkTreeIter, 1);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
930 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++);
3567
ec86e76d0427 [gaim-migrate @ 3663]
Sean Egan <seanegan@gmail.com>
parents: 3565
diff changeset
931 if (gtk_tree_model_iter_n_children(GTK_TREE_MODEL(prefstree), &plugin_iter) == 1) {
ec86e76d0427 [gaim-migrate @ 3663]
Sean Egan <seanegan@gmail.com>
parents: 3565
diff changeset
932 /* Expand the tree for the first plugin added */
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
933 GtkTreePath *path2 = gtk_tree_model_get_path(GTK_TREE_MODEL(prefstree), &plugin_iter);
3567
ec86e76d0427 [gaim-migrate @ 3663]
Sean Egan <seanegan@gmail.com>
parents: 3565
diff changeset
934 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_v), path2, TRUE);
ec86e76d0427 [gaim-migrate @ 3663]
Sean Egan <seanegan@gmail.com>
parents: 3565
diff changeset
935 gtk_tree_path_free (path2);
ec86e76d0427 [gaim-migrate @ 3663]
Sean Egan <seanegan@gmail.com>
parents: 3565
diff changeset
936 }
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
937 }
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
938 }
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
939 #else
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
940 {}
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
941 #endif
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
942 else
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
943 #ifdef USE_PERL
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
944 perl_load_file(plug->path);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
945 #else
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
946 {}
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
947 #endif
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
948 else
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
949 if (plug->type == plugin)
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
950 #ifdef GAIM_PLUGINS
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
951 {
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
952 unload_plugin(plug);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
953 if (plug->iter) {
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
954 gtk_tree_store_remove(GTK_TREE_STORE(prefstree), plug->iter);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
955 g_free(plug->iter);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
956 plug->iter = NULL;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
957 }
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
958 }
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
959 #else
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
960 {}
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
961 #endif
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
962 else
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
963 #ifdef USE_PERL
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
964 perl_unload_file(plug);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
965 #else
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
966 {}
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
967 #endif
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
968 gdk_window_set_cursor(prefs->window, NULL);
3563
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
969 if (plug->error[0])
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
970 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n"
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
971 "<span weight=\"bold\" color=\"red\">%s</span>\n\n"
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
972 "%s"), plug->desc.name, plug->desc.version, plug->error, plug->desc.description);
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
973 else
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
974 g_snprintf(buf, sizeof(buf), _("<span size=\"larger\">%s %s</span>\n\n"
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
975 "%s"), plug->desc.name, plug->desc.version, plug->desc.description);
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
976 gtk_label_set_markup(GTK_LABEL(plugin_description), buf);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
977 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, plug->handle, -1);
3563
e120097bbd72 [gaim-migrate @ 3658]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
978
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
979 gtk_label_set_markup(GTK_LABEL(plugin_description), buf);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
980 gtk_tree_path_free(path);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
981 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
982
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
983 static GtkWidget *plugin_page ()
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
984 {
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
985 GtkWidget *ret;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
986
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
987 GtkWidget *sw, *vp;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
988 GtkTreeIter iter;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
989 GtkWidget *event_view;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
990 GtkListStore *ls;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
991 GtkCellRenderer *rend, *rendt;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
992 GtkTreeViewColumn *col;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
993 GtkTreeSelection *sel;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
994 GtkTreePath *path;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
995
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
996 GtkWidget *nb;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
997
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
998 GList *probes = probed_plugins;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
999 struct gaim_plugin *plug;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1000
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1001 ret = gtk_vbox_new(FALSE, 18);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1002 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1003
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1004 sw = gtk_scrolled_window_new(NULL,NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1005 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
1006 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
1007
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1008 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1009
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1010 ls = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_POINTER);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1011 while (probes) {
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1012 plug = probes->data;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1013 gtk_list_store_append (ls, &iter);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1014 gtk_list_store_set(ls, &iter,
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1015 0, plug->handle,
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1016 1, plug->desc.name ? plug->desc.name : plug->path,
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1017 2, plug, -1);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1018 probes = probes->next;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1019 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1020
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1021 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
1022
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1023 rend = gtk_cell_renderer_toggle_new();
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1024 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view));
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1025
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1026
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1027 col = gtk_tree_view_column_new_with_attributes ("Load",
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1028 rend,
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1029 "active", 0,
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1030 NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1031 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1032
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1033 rendt = gtk_cell_renderer_text_new();
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1034 col = gtk_tree_view_column_new_with_attributes ("Name",
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1035 rendt,
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1036 "text", 1,
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1037 NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1038 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1039 g_object_unref(G_OBJECT(ls));
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1040 gtk_container_add(GTK_CONTAINER(sw), event_view);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1041
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1042
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1043 nb = gtk_notebook_new();
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1044 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(nb), GTK_POS_BOTTOM);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1045 gtk_notebook_popup_disable(GTK_NOTEBOOK(nb));
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1046
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1047 /* Description */
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1048 sw = gtk_scrolled_window_new(NULL, NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1049 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
1050 plugin_description = gtk_label_new(NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1051
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1052 vp = gtk_viewport_new(NULL, NULL);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1053 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
1054 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
1055
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1056 gtk_container_add(GTK_CONTAINER(vp), plugin_description);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1057 gtk_container_add(GTK_CONTAINER(sw), vp);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1058
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1059 gtk_label_set_selectable(GTK_LABEL(plugin_description), TRUE);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1060 gtk_label_set_line_wrap(GTK_LABEL(plugin_description), TRUE);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1061 gtk_misc_set_alignment(GTK_MISC(plugin_description), 0, 0);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1062 gtk_misc_set_padding(GTK_MISC(plugin_description), 6, 6);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1063 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
1064
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1065 /* Details */
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1066 sw = gtk_scrolled_window_new(NULL, NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1067 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
1068 plugin_details = gtk_label_new(NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1069
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1070 vp = gtk_viewport_new(NULL, NULL);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1071 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
1072 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
1073
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1074 gtk_container_add(GTK_CONTAINER(vp), plugin_details);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1075 gtk_container_add(GTK_CONTAINER(sw), vp);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1076
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1077 gtk_label_set_selectable(GTK_LABEL(plugin_details), TRUE);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1078 gtk_label_set_line_wrap(GTK_LABEL(plugin_details), TRUE);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1079 gtk_misc_set_alignment(GTK_MISC(plugin_details), 0, 0);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1080 gtk_misc_set_padding(GTK_MISC(plugin_details), 6, 6);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1081 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
1082 gtk_box_pack_start(GTK_BOX(ret), nb, TRUE, TRUE, 0);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1083
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1084 g_signal_connect (G_OBJECT (sel), "changed",
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1085 G_CALLBACK (prefs_plugin_sel),
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1086 NULL);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1087 g_signal_connect (G_OBJECT(rend), "toggled",
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1088 G_CALLBACK(plugin_load), ls);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1089
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1090 path = gtk_tree_path_new_first();
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1091 gtk_tree_selection_select_path(sel, path);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1092 gtk_tree_path_free(path);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1093
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1094 gtk_widget_show_all(ret);
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1095 return ret;
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1096 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1097 #endif
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1098
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1099 static void event_toggled (GtkCellRendererToggle *cell, gchar *pth, gpointer data)
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1100 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1101 GtkTreeModel *model = (GtkTreeModel *)data;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1102 GtkTreeIter iter;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1103 GtkTreePath *path = gtk_tree_path_new_from_string(pth);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1104 gint soundnum;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1105
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1106 gtk_tree_model_get_iter (model, &iter, path);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1107 gtk_tree_model_get (model, &iter, 2, &soundnum, -1);
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1108
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1109 sound_options_new ^= sounds[soundnum].opt;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1110 gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, sound_options_new & sounds[soundnum].opt, -1);
3522
62bef830ce61 [gaim-migrate @ 3595]
Sean Egan <seanegan@gmail.com>
parents: 3515
diff changeset
1111
62bef830ce61 [gaim-migrate @ 3595]
Sean Egan <seanegan@gmail.com>
parents: 3515
diff changeset
1112 gtk_tree_path_free(path);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1113 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1114
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1115 static void test_sound(GtkWidget *button, gpointer i_am_NULL)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1116 {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1117 guint32 tmp_sound = sound_options;
3401
1be15204741f [gaim-migrate @ 3420]
Sean Egan <seanegan@gmail.com>
parents: 3391
diff changeset
1118 char *save_me=NULL;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1119 if (!(sound_options & OPT_SOUND_WHEN_AWAY))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1120 sound_options ^= OPT_SOUND_WHEN_AWAY;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1121 if (!(sound_options & sounds[sound_row_sel].opt))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1122 sound_options ^= sounds[sound_row_sel].opt;
3401
1be15204741f [gaim-migrate @ 3420]
Sean Egan <seanegan@gmail.com>
parents: 3391
diff changeset
1123 save_me = sound_file[sound_row_sel];
1be15204741f [gaim-migrate @ 3420]
Sean Egan <seanegan@gmail.com>
parents: 3391
diff changeset
1124 sound_file[sound_row_sel] = sound_file_new[sound_row_sel];
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1125 play_sound(sound_row_sel);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1126
3401
1be15204741f [gaim-migrate @ 3420]
Sean Egan <seanegan@gmail.com>
parents: 3391
diff changeset
1127 sound_file[sound_row_sel] = save_me;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1128 sound_options = tmp_sound;
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1129 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1130
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1131 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
1132 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1133 /* This just resets a sound file back to default */
3485
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1134 if (sound_file_new[sound_row_sel]) {
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1135 g_free(sound_file_new[sound_row_sel]);
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1136 sound_file_new[sound_row_sel] = NULL;
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1137 }
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1138
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1139 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)");
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1140 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1141
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1142 void close_sounddialog(GtkWidget *w, GtkWidget *w2)
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1143 {
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1144
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1145 GtkWidget *dest;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1146
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1147 if (!GTK_IS_WIDGET(w2))
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1148 dest = w;
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1149 else
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1150 dest = w2;
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1151
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1152 sounddialog = NULL;
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1153
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1154 gtk_widget_destroy(dest);
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1155 }
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1156
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1157 void do_select_sound(GtkWidget *w, int snd)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1158 {
1953
f0ff0b367e3d [gaim-migrate @ 1963]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1930
diff changeset
1159 const char *file;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1160
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1161 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(sounddialog));
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1162
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1163 /* If they type in a directory, change there */
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1164 if (file_is_dir(file, sounddialog))
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1165 return;
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1166
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1167 /* Let's just be safe */
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1168 if (sound_file_new[snd])
3485
6187c93da61a [gaim-migrate @ 3539]
Sean Egan <seanegan@gmail.com>
parents: 3474
diff changeset
1169 g_free(sound_file_new[snd]);
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1171 /* Set it -- and forget it */
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1172 sound_file_new[snd] = g_strdup(file);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1173
1175
581b3e015036 [gaim-migrate @ 1185]
Rob Flynn <gaim@robflynn.com>
parents: 1173
diff changeset
1174 /* Set our text entry */
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1175 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[snd]);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1176
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1177 /* Close the window! It's getting cold in here! */
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1178 close_sounddialog(NULL, sounddialog);
2471
612efbf62c35 [gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2385
diff changeset
1179
612efbf62c35 [gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2385
diff changeset
1180 if (last_sound_dir)
612efbf62c35 [gaim-migrate @ 2484]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2385
diff changeset
1181 g_free(last_sound_dir);
3429
1b18d4693d32 [gaim-migrate @ 3455]
Sean Egan <seanegan@gmail.com>
parents: 3427
diff changeset
1182 last_sound_dir = g_dirname(sound_file_new[snd]);
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1183 }
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1184
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1185 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
1186 {
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1187 char *buf = g_malloc(BUF_LEN);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1188
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1189 if (!sounddialog) {
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1190 sounddialog = gtk_file_selection_new(_("Gaim - Sound Configuration"));
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1191
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1192 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(sounddialog));
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1193
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1194 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
1195
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1196 gtk_file_selection_set_filename(GTK_FILE_SELECTION(sounddialog), buf);
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1197
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1198 gtk_signal_connect(GTK_OBJECT(sounddialog), "destroy",
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1199 GTK_SIGNAL_FUNC(close_sounddialog), sounddialog);
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1200
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1201 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->ok_button),
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1202 "clicked", GTK_SIGNAL_FUNC(do_select_sound), (int *)sound_row_sel);
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1203
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1204 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(sounddialog)->cancel_button),
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1205 "clicked", GTK_SIGNAL_FUNC(close_sounddialog), sounddialog);
1170
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1206 }
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1207
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1208 g_free(buf);
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1209 gtk_widget_show(sounddialog);
16d748023b2b [gaim-migrate @ 1180]
Rob Flynn <gaim@robflynn.com>
parents: 1147
diff changeset
1210 gdk_window_raise(sounddialog->window);
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1211 }
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1212
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1213
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1214 static void prefs_sound_sel (GtkTreeSelection *sel, GtkTreeModel *model) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1215 GtkTreeIter iter;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1216 GValue val = { 0, };
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1217
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1218 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1219 return;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1220 gtk_tree_model_get_value (model, &iter, 2, &val);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1221 sound_row_sel = g_value_get_uint(&val);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1222 if (sound_entry)
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1223 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[sound_row_sel] ? sound_file_new[sound_row_sel] : "(default)");
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1224 g_value_unset (&val);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1225 if (sounddialog)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1226 gtk_widget_destroy(sounddialog);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1227 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1228
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1229 GtkWidget *sound_events_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1230
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1231 GtkWidget *ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1232 GtkWidget *sw;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1233 GtkWidget *button, *hbox;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1234 GtkTreeIter iter;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1235 GtkWidget *event_view;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1236 GtkListStore *event_store;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1237 GtkCellRenderer *rend;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1238 GtkTreeViewColumn *col;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1239 GtkTreeSelection *sel;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1240 GtkTreePath *path;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1241 int j;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1242
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1243 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1244 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1245
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1246 sw = gtk_scrolled_window_new(NULL,NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1247 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1248 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
1249 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
1250
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1251 for (j=0; j < NUM_SOUNDS; j++) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1252 if (sounds[j].opt == 0)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1253 continue;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1254
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1255 gtk_list_store_append (event_store, &iter);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1256 gtk_list_store_set(event_store, &iter,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1257 0, sound_options & sounds[j].opt,
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1258 1, sounds[j].label,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1259 2, j, -1);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1260 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1261
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1262 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
1263
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1264 rend = gtk_cell_renderer_toggle_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1265 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1266 g_signal_connect (G_OBJECT (sel), "changed",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1267 G_CALLBACK (prefs_sound_sel),
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1268 NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1269 g_signal_connect (G_OBJECT(rend), "toggled",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1270 G_CALLBACK(event_toggled), event_store);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1271 path = gtk_tree_path_new_first();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1272 gtk_tree_selection_select_path(sel, path);
3522
62bef830ce61 [gaim-migrate @ 3595]
Sean Egan <seanegan@gmail.com>
parents: 3515
diff changeset
1273 gtk_tree_path_free(path);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1274
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1275 col = gtk_tree_view_column_new_with_attributes ("Play",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1276 rend,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1277 "active", 0,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1278 NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1279 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1280
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1281 rend = gtk_cell_renderer_text_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1282 col = gtk_tree_view_column_new_with_attributes ("Event",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1283 rend,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1284 "text", 1,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1285 NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1286 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
1287 g_object_unref(G_OBJECT(event_store));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1288 gtk_container_add(GTK_CONTAINER(sw), event_view);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1289
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1290 hbox = gtk_hbox_new(FALSE, 6);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1291 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
1292 sound_entry = gtk_entry_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1293 gtk_entry_set_text(GTK_ENTRY(sound_entry), sound_file_new[0] ? sound_file_new[0] : "(default)");
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1294 gtk_entry_set_editable(GTK_ENTRY(sound_entry), FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1295 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
1296
3025
0486d3d00d0e [gaim-migrate @ 3038]
Sean Egan <seanegan@gmail.com>
parents: 3013
diff changeset
1297 button = gtk_button_new_with_label(_("Test"));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1298 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(test_sound), NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1299 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
1300
1175
581b3e015036 [gaim-migrate @ 1185]
Rob Flynn <gaim@robflynn.com>
parents: 1173
diff changeset
1301 button = gtk_button_new_with_label(_("Reset"));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1302 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(reset_sound), NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1303 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
1304
1381
1bbdebd66afd [gaim-migrate @ 1391]
Rob Flynn <gaim@robflynn.com>
parents: 1370
diff changeset
1305 button = gtk_button_new_with_label(_("Choose..."));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1306 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(sel_sound), NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1307 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
1308
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1309 gtk_widget_show_all (ret);
1006
0a4d0ed65e17 [gaim-migrate @ 1016]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1002
diff changeset
1310
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1311 return ret;
2580
86eaeb064e82 [gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2566
diff changeset
1312 }
86eaeb064e82 [gaim-migrate @ 2593]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2566
diff changeset
1313
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1314 void away_message_sel(GtkTreeSelection *sel, GtkTreeModel *model)
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1315 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1316 GtkTreeIter iter;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1317 GValue val = { 0, };
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1318 gchar buffer[BUF_LONG];
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1319 char *tmp;
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1320 struct away_message *am;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1321
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1322 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1323 return;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1324 gtk_tree_model_get_value (model, &iter, 1, &val);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1325 am = g_value_get_pointer(&val);
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1326 gtk_imhtml_clear(GTK_IMHTML(away_text));
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1327 strncpy(buffer, am->message, BUF_LONG);
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1328 tmp = stylize(buffer, BUF_LONG);
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2843
diff changeset
1329 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
1330 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL);
2856
b1e300a85678 [gaim-migrate @ 2869]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2843
diff changeset
1331 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
1332 GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_SCROLL);
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1333 g_free(tmp);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1334 g_value_unset (&val);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1335
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1336 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1337
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1338 void remove_away_message(GtkWidget *widget, GtkTreeView *tv) {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1339 struct away_message *am;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1340 GtkTreeIter iter;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1341 GtkTreePath *path;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1342 GtkTreeStore *ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1343 GtkTreeSelection *sel = gtk_tree_view_get_selection(tv);
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1344 GtkTreeModel *model = GTK_TREE_MODEL(prefs_away_store);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1345 GValue val = { 0, };
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1346
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1347 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1348 return;
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1349 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
1350 am = g_value_get_pointer (&val);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1351 gtk_imhtml_clear(GTK_IMHTML(away_text));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1352 rem_away_mess(NULL, am);
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1353 gtk_list_store_remove(GTK_LIST_STORE(ts), &iter);
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1354 path = gtk_tree_path_new_first();
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1355 gtk_tree_selection_select_path(sel, path);
3522
62bef830ce61 [gaim-migrate @ 3595]
Sean Egan <seanegan@gmail.com>
parents: 3515
diff changeset
1356 gtk_tree_path_free(path);
1109
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1087
diff changeset
1357 }
c73736fa0b7c [gaim-migrate @ 1119]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1087
diff changeset
1358
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1359 GtkWidget *away_message_page() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1360 GtkWidget *ret;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1361 GtkWidget *hbox;
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1362 GtkWidget *button;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1363 GtkWidget *sw;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1364 GtkTreeIter iter;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1365 GtkWidget *event_view;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1366 GtkCellRenderer *rend;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1367 GtkTreeViewColumn *col;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1368 GtkTreeSelection *sel;
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 930
diff changeset
1369 GSList *awy = away_messages;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1370 struct away_message *a;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1371 GtkWidget *sw2;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1372 GtkSizeGroup *sg;
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1373
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1374 ret = gtk_vbox_new(FALSE, 18);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1375 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1376
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1377 sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1378
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1379 sw = gtk_scrolled_window_new(NULL,NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1380 away_text = gtk_imhtml_new(NULL, NULL);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1381 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1382 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
1383 GTK_SHADOW_IN);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1384 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
1385
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1386 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
1387 while (awy) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1388 a = (struct away_message *)awy->data;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1389 gtk_list_store_append (prefs_away_store, &iter);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1390 gtk_list_store_set(prefs_away_store, &iter,
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1391 0, a->name,
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1392 1, a, -1);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1393 awy = awy->next;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1394 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1395 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
1396
2906
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2856
diff changeset
1397
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1398 rend = gtk_cell_renderer_text_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1399 col = gtk_tree_view_column_new_with_attributes ("NULL",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1400 rend,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1401 "text", 0,
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1402 NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1403 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1404 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
1405 gtk_widget_show(event_view);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1406 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
1407
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1408 sw2 = gtk_scrolled_window_new(NULL, NULL);
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1409 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2),
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1410 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1411 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
1412
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1413 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), away_text);
2906
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2856
diff changeset
1414 GTK_LAYOUT(away_text)->hadjustment->step_increment = 10.0;
538c58b43eff [gaim-migrate @ 2919]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2856
diff changeset
1415 GTK_LAYOUT(away_text)->vadjustment->step_increment = 10.0;
1815
f15d449b3167 [gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1813
diff changeset
1416 gaim_setup_imhtml(away_text);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1417 gtk_imhtml_set_defaults(GTK_IMHTML(away_text), NULL, NULL, NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1418 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1419 g_signal_connect (G_OBJECT (sel), "changed",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1420 G_CALLBACK (away_message_sel),
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1421 NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1422 hbox = gtk_hbox_new(TRUE, 5);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1423 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
1424 button = gtk_button_new_from_stock (GTK_STOCK_ADD);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1425 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
1426 gtk_size_group_add_widget(sg, button);
1780
d7cbedd1d651 [gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1773
diff changeset
1427 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL);
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1428
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1429 button = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1430 gtk_size_group_add_widget(sg, button);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1431 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), event_view);
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1432
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1433 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
1434
3649
f09193608fd3 [gaim-migrate @ 3773]
Rob Flynn <gaim@robflynn.com>
parents: 3630
diff changeset
1435 button = gaim_pixbuf_button(_("_Edit"), "edit.png", GAIM_BUTTON_HORIZONTAL);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1436 gtk_size_group_add_widget(sg, button);
3374
3cd2fbddf95a [gaim-migrate @ 3393]
Sean Egan <seanegan@gmail.com>
parents: 3373
diff changeset
1437 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), event_view);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1438 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
1439
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1440 gtk_widget_show_all(ret);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1441 return ret;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1442 }
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1443
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1444 GtkTreeIter *prefs_notebook_add_page(char *text,
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1445 GdkPixbuf *pixbuf,
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1446 GtkWidget *page,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1447 GtkTreeIter *iter,
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1448 GtkTreeIter *parent,
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1449 int ind) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1450 GdkPixbuf *icon = NULL;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1451
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1452 if (pixbuf)
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1453 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
1454
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1455 gtk_tree_store_append (prefstree, iter, parent);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1456 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
1457
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1458 if (pixbuf)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1459 g_object_unref(pixbuf);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1460 if (icon)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1461 g_object_unref(icon);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1462 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
1463 return iter;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1464 }
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
1465
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1466 void prefs_notebook_init() {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1467 GtkTreeIter p, c;
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1468 #if USE_PLUGINS
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1469 GtkWidget *(*config)();
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1470 GList *l = plugins;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1471 struct gaim_plugin *plug;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1472 #endif
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1473 prefs_notebook_add_page(_("Interface"), NULL, interface_page(), &p, NULL, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1474 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
1475 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
1476 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
1477 prefs_notebook_add_page(_("Buddy List"), NULL, list_page(), &c, &p, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1478 prefs_notebook_add_page(_("IM Window"), NULL, im_page(), &c, &p, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1479 prefs_notebook_add_page(_("Chat Window"), NULL, chat_page(), &c, &p, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1480 prefs_notebook_add_page(_("Tabs"), NULL, tab_page(), &c, &p, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1481 prefs_notebook_add_page(_("Proxy"), NULL, proxy_page(), &p, NULL, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1482 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++);
1130
d31fad9abb32 [gaim-migrate @ 1140]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1125
diff changeset
1483
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1484 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
1485 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
1486 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
1487 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
1488 prefs_notebook_add_page(_("Away Messages"), NULL, away_message_page(), &c, &p, notebook_page++);
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1489 #if USE_PLUGINS
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1490 prefs_notebook_add_page(_("Plugins"), NULL, plugin_page(), &plugin_iter, NULL, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1491 while (l) {
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1492 plug = l->data;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1493 if (plug->type == plugin && g_module_symbol(plug->handle, "gaim_plugin_config_gtk", (gpointer *)&config)) {
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1494 plug->iter = g_new0(GtkTreeIter, 1);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1495 prefs_notebook_add_page(plug->desc.name, NULL, config(), plug->iter, &plugin_iter, notebook_page++);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1496 }
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1497 l = l->next;
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3563
diff changeset
1498 }
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 3526
diff changeset
1499 #endif
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
1500 }
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
1501
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1502 void show_prefs()
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
1503 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1504 GtkWidget *vbox, *vbox2;
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
1505 GtkWidget *hbox;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1506 GtkWidget *frame;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1507 GtkTreeViewColumn *column;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1508 GtkCellRenderer *cell;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1509 GtkTreeSelection *sel;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1510 GtkWidget *notebook;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1511 GtkWidget *sep;
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
1512 GtkWidget *button;
3515
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1513 GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1514
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1515 int r;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1516
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1517 if (prefs) {
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1518 gtk_window_present(GTK_WINDOW(prefs));
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1519 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1520 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1521
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1522 /* copy the preferences to tmp values...
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1523 * I liked "take affect immediately" Oh well :-( */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1524 misc_options_new = misc_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1525 logging_options_new = logging_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1526 blist_options_new = blist_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1527 convo_options_new = convo_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1528 im_options_new = im_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1529 chat_options_new = chat_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1530 font_options_new = font_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1531 sound_options_new = sound_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1532 for (r = 0; r < NUM_SOUNDS; r++)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1533 sound_file_new[r] = g_strdup(sound_file[r]);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1534 away_options_new = away_options;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1535 away_resend_new = away_resend;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1536 report_idle_new = report_idle;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1537 auto_away_new = auto_away;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1538 default_away_new = default_away;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1539 fontsize_new = fontsize;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1540 web_browser_new = web_browser;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1541 proxytype_new = proxytype;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1542 #ifndef _WIN32
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1543 g_snprintf(sound_cmd_new, sizeof(sound_cmd_new), "%s", sound_cmd);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1544 #endif
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3567
diff changeset
1545 g_snprintf(web_command_new, sizeof(web_command_new), "%s",
3434
0c281a80767d [gaim-migrate @ 3463]
Sean Egan <seanegan@gmail.com>
parents: 3433
diff changeset
1546 web_command ? web_command : "xterm -e lynx %%s");
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1547 g_snprintf(fontface_new, sizeof(fontface_new), fontface);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1548 memcpy(&conv_size_new, &conv_size, sizeof(struct window_size));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1549 memcpy(&buddy_chat_size_new, &buddy_chat_size, sizeof(struct window_size));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1550 memcpy(&fgcolor_new, &fgcolor, sizeof(GdkColor));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1551 memcpy(&bgcolor_new, &bgcolor, sizeof(GdkColor));
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1552
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1553 /* Create the window */
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1554 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 902
diff changeset
1555 gtk_window_set_wmclass(GTK_WINDOW(prefs), "preferences", "Gaim");
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1556 gtk_widget_realize(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1557 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences"));
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1558 gtk_window_set_policy (GTK_WINDOW(prefs), FALSE, FALSE, TRUE);
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1559 gtk_signal_connect(GTK_OBJECT(prefs), "destroy", GTK_SIGNAL_FUNC(delete_prefs), NULL);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1560
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1561 vbox = gtk_vbox_new(FALSE, 5);
1185
47cf56b72d4b [gaim-migrate @ 1195]
Rob Flynn <gaim@robflynn.com>
parents: 1176
diff changeset
1562 gtk_container_border_width(GTK_CONTAINER(vbox), 5);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1563 gtk_container_add(GTK_CONTAINER(prefs), vbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1564 gtk_widget_show(vbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1565
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1566 hbox = gtk_hbox_new (FALSE, 6);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1567 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1568 gtk_container_add (GTK_CONTAINER(vbox), hbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1569 gtk_widget_show (hbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1570
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1571 frame = gtk_frame_new (NULL);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1572 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1573 gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1574 gtk_widget_show (frame);
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 /* The tree -- much inspired by the Gimp */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1577 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
1578 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
1579 gtk_container_add (GTK_CONTAINER (frame), tree_v);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1580
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1581 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
1582 gtk_widget_show(tree_v);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1583 /* icons */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1584 cell = gtk_cell_renderer_pixbuf_new ();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1585 column = gtk_tree_view_column_new_with_attributes ("icons", cell, "pixbuf", 0, NULL);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1586
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1587 /* text */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1588 cell = gtk_cell_renderer_text_new ();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1589 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
1590
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1591 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
1592
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1593 /* The right side */
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1594 frame = gtk_frame_new (NULL);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1595 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1596 gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1597 gtk_widget_show (frame);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1598
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1599 vbox2 = gtk_vbox_new (FALSE, 4);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1600 gtk_container_add (GTK_CONTAINER (frame), vbox2);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1601 gtk_widget_show (vbox2);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1602
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1603 frame = gtk_frame_new (NULL);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1604 gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1605 gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, TRUE, 0);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1606 gtk_widget_show (frame);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1607
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1608 hbox = gtk_hbox_new (FALSE, 4);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1609 gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1610 gtk_container_add (GTK_CONTAINER (frame), hbox);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1611 gtk_widget_show (hbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1612
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1613 preflabel = gtk_label_new(NULL);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1614 gtk_box_pack_end (GTK_BOX (hbox), preflabel, FALSE, FALSE, 0);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1615 gtk_widget_show (preflabel);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1616
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1617 /* The notebook */
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1618 prefsnotebook = notebook = gtk_notebook_new ();
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1619 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1620 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1621 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
1622
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1623 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_v));
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1624 g_signal_connect (G_OBJECT (sel), "changed",
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1625 G_CALLBACK (pref_nb_select),
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1626 notebook);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1627 gtk_widget_show(notebook);
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1628 sep = gtk_hseparator_new();
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1629 gtk_widget_show(sep);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1630 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
1631
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1632 /* The buttons to press! */
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1633 hbox = gtk_hbox_new (FALSE, 6);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1634 gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1635 gtk_container_add (GTK_CONTAINER(vbox), hbox);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1636 gtk_widget_show (hbox);
3377
783e982a56da [gaim-migrate @ 3396]
Sean Egan <seanegan@gmail.com>
parents: 3374
diff changeset
1637
3509
8bad870eaea1 [gaim-migrate @ 3575]
Rob Flynn <gaim@robflynn.com>
parents: 3507
diff changeset
1638 button = gtk_button_new_from_stock (GTK_STOCK_OK);
3515
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1639 gtk_size_group_add_widget(sg, button);
3509
8bad870eaea1 [gaim-migrate @ 3575]
Rob Flynn <gaim@robflynn.com>
parents: 3507
diff changeset
1640 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(ok_cb), prefs);
8bad870eaea1 [gaim-migrate @ 3575]
Rob Flynn <gaim@robflynn.com>
parents: 3507
diff changeset
1641 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
8bad870eaea1 [gaim-migrate @ 3575]
Rob Flynn <gaim@robflynn.com>
parents: 3507
diff changeset
1642 gtk_widget_show(button);
8bad870eaea1 [gaim-migrate @ 3575]
Rob Flynn <gaim@robflynn.com>
parents: 3507
diff changeset
1643
3515
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1644 button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1645 gtk_size_group_add_widget(sg, button);
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1646 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), prefs);
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1647 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1648 gtk_widget_show(button);
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1649
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1650 button = gtk_button_new_from_stock (GTK_STOCK_APPLY);
3515
54c508cce1bc [gaim-migrate @ 3588]
Rob Flynn <gaim@robflynn.com>
parents: 3509
diff changeset
1651 gtk_size_group_add_widget(sg, button);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1652 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(apply_cb), prefs);
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1653 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1654 gtk_widget_show(button);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1655
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1656
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1657 prefs_notebook_init();
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1658
3472
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1659 gtk_tree_view_expand_all (GTK_TREE_VIEW(tree_v));
d33ec392a5e1 [gaim-migrate @ 3523]
Sean Egan <seanegan@gmail.com>
parents: 3466
diff changeset
1660 gtk_widget_show(prefs);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1661 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1662
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1663 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1664 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1665 if (debugbutton)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1666 gtk_button_clicked(GTK_BUTTON(debugbutton));
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1667 if (misc_options & OPT_MISC_DEBUG) {
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1668 misc_options_new ^= OPT_MISC_DEBUG;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1669 misc_options ^= OPT_MISC_DEBUG;
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1670 save_prefs();
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1671 }
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1672 g_free(dw);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1673 dw = NULL;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1674 return FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1675
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1676 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1677
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1678 static void build_debug()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1679 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1680 GtkWidget *scroll;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1681 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1682 if (!dw)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1683 dw = g_new0(struct debug_window, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1684
2725
f3c094e78609 [gaim-migrate @ 2738]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2676
diff changeset
1685 GAIM_DIALOG(dw->window);
2536
0e0a54e5819a [gaim-migrate @ 2549]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2471
diff changeset
1686 gtk_window_set_title(GTK_WINDOW(dw->window), _("Gaim debug output window"));
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1687 gtk_window_set_wmclass(GTK_WINDOW(dw->window), "debug_out", "Gaim");
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1688 gtk_signal_connect(GTK_OBJECT(dw->window), "delete_event", GTK_SIGNAL_FUNC(debug_delete), NULL);
2547
ab55ac6234b8 [gaim-migrate @ 2560]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2536
diff changeset
1689 gtk_widget_realize(dw->window);
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1690
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1691 box = gtk_hbox_new(FALSE, 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1692 gtk_container_add(GTK_CONTAINER(dw->window), box);
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1693 gtk_widget_show(box);
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1694
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1695 dw->entry = gtk_text_new(NULL, NULL);
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1696 gtk_text_set_word_wrap(GTK_TEXT(dw->entry), TRUE);
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1697 gtk_text_set_editable(GTK_TEXT(dw->entry), FALSE);
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1698 gtk_container_add(GTK_CONTAINER(box), dw->entry);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1699 gtk_widget_set_usize(dw->entry, 500, 200);
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1700 gtk_widget_show(dw->entry);
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1701
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1702 scroll = gtk_vscrollbar_new(GTK_TEXT(dw->entry)->vadj);
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1703 gtk_box_pack_start(GTK_BOX(box), scroll, FALSE, FALSE, 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1704 gtk_widget_show(scroll);
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1705
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1706 gtk_widget_show(dw->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1707 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1708
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1709 void show_debug()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1710 {
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1711 if ((misc_options & OPT_MISC_DEBUG)) {
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1712 if (!dw || !dw->window)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1713 build_debug();
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1714 gtk_widget_show(dw->window);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1715 } else {
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1716 if (!dw)
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1717 return;
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1718 gtk_widget_destroy(dw->window);
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1719 dw->window = NULL;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1720 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1721 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1722
970
9eb07b383df4 [gaim-migrate @ 980]
Rob Flynn <gaim@robflynn.com>
parents: 967
diff changeset
1723 void debug_printf(char *fmt, ...)
9eb07b383df4 [gaim-migrate @ 980]
Rob Flynn <gaim@robflynn.com>
parents: 967
diff changeset
1724 {
9eb07b383df4 [gaim-migrate @ 980]
Rob Flynn <gaim@robflynn.com>
parents: 967
diff changeset
1725 va_list ap;
9eb07b383df4 [gaim-migrate @ 980]
Rob Flynn <gaim@robflynn.com>
parents: 967
diff changeset
1726 gchar *s;
9eb07b383df4 [gaim-migrate @ 980]
Rob Flynn <gaim@robflynn.com>
parents: 967
diff changeset
1727
1366
155db3303ebb [gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1357
diff changeset
1728 va_start(ap, fmt);
155db3303ebb [gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1357
diff changeset
1729 s = g_strdup_vprintf(fmt, ap);
155db3303ebb [gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1357
diff changeset
1730 va_end(ap);
155db3303ebb [gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1357
diff changeset
1731
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1732 if (misc_options & OPT_MISC_DEBUG && dw) {
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1733 GtkAdjustment *adj = GTK_TEXT(dw->entry)->vadj;
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1734 gboolean scroll = (adj->value == adj->upper - adj->lower - adj->page_size);
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1735
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1736 gtk_text_freeze(GTK_TEXT(dw->entry));
970
9eb07b383df4 [gaim-migrate @ 980]
Rob Flynn <gaim@robflynn.com>
parents: 967
diff changeset
1737 gtk_text_insert(GTK_TEXT(dw->entry), NULL, NULL, NULL, s, -1);
2282
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1738 gtk_text_thaw(GTK_TEXT(dw->entry));
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1739
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1740 if (scroll)
0dea5214d63f [gaim-migrate @ 2292]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2269
diff changeset
1741 gtk_adjustment_set_value(adj, adj->upper - adj->lower - adj->page_size);
1366
155db3303ebb [gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1357
diff changeset
1742 }
2823
cd23279122ed [gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2794
diff changeset
1743 if (opt_debug)
cd23279122ed [gaim-migrate @ 2836]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2794
diff changeset
1744 g_print("%s", s);
1366
155db3303ebb [gaim-migrate @ 1376]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1357
diff changeset
1745 g_free(s);
970
9eb07b383df4 [gaim-migrate @ 980]
Rob Flynn <gaim@robflynn.com>
parents: 967
diff changeset
1746 }
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1747
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1748
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1749
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1750
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1751
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1752
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1753 void set_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1754 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1755 *option = !(*option);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1756 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1757
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1758 static void set_misc_option(GtkWidget *w, int option)
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1759 {
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1760 misc_options_new ^= option;
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1761
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1762 /* gross hack because we don't want to save all prefs just because
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1763 * we enabled the debug window. then again, what about the debug
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1764 * window _isn't_ an ugly hack? */
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1765
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1766 if (option == OPT_MISC_DEBUG) {
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1767 misc_options ^= option;
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1768 save_prefs();
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1769 show_debug();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1770 }
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1771 }
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1772
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1773
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1774 /* Functions for each _options variable that sees what's changed, and makes
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1775 * effective those changes that take place immediately (UI stuff) */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1776 static void set_misc_options()
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1777 {
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1778
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1779 /* int option = misc_options ^ misc_options_new; */
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1780 misc_options = misc_options_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1781
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1782 }
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1783
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1784 static void set_logging_options()
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1785 {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1786 int option = logging_options ^ logging_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1787 logging_options = logging_options_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1788
3457
222e23f91092 [gaim-migrate @ 3505]
Sean Egan <seanegan@gmail.com>
parents: 3434
diff changeset
1789 if (option & OPT_LOG_CONVOS || option & OPT_LOG_CHATS)
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1790 update_log_convs();
1773
6d1d9e988fd4 [gaim-migrate @ 1783]
Rob Flynn <gaim@robflynn.com>
parents: 1757
diff changeset
1791
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1792 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1793
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1794 static void set_blist_options()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1795 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1796 int option = blist_options ^ blist_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1797 blist_options = blist_options_new;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1798
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1799 if (!blist)
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1800 return;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1801
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1802 if (option & OPT_BLIST_BOTTOM_TAB)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1803 set_blist_tab();
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1804
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1805 if (option & OPT_BLIST_NO_BUTTONS)
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1806 build_imchat_box(!(blist_options & OPT_BLIST_NO_BUTTONS));
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 683
diff changeset
1807
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1808 if (option & OPT_BLIST_SHOW_GRPNUM)
1070
b288f17c2fb2 [gaim-migrate @ 1080]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1030
diff changeset
1809 update_num_groups();
9
effb8a20de26 [gaim-migrate @ 18]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
1810
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1811 if (option & OPT_BLIST_NO_MT_GRP)
1072
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1812 toggle_show_empty_groups();
81d19577285a [gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1070
diff changeset
1813
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1814 if ((option & OPT_BLIST_SHOW_BUTTON_XPM) || (option & OPT_BLIST_NO_BUTTONS))
1296
11e5b1220028 [gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1269
diff changeset
1815 update_button_pix();
11e5b1220028 [gaim-migrate @ 1306]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1269
diff changeset
1816
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1817 if (option & OPT_BLIST_SHOW_PIXMAPS)
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1818 toggle_buddy_pixmaps();
2593
5ba9ef368b8e [gaim-migrate @ 2606]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2592
diff changeset
1819
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1820 if ((option & OPT_BLIST_GREY_IDLERS) || (option & OPT_BLIST_SHOW_IDLETIME))
2594
c133c9499f23 [gaim-migrate @ 2607]
Rob Flynn <gaim@robflynn.com>
parents: 2593
diff changeset
1821 update_idle_times();
3032
d3536105d581 [gaim-migrate @ 3045]
Rob Flynn <gaim@robflynn.com>
parents: 3025
diff changeset
1822
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1823 }
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1824
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1825 static void set_convo_options()
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1826 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1827 int option = convo_options ^ convo_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1828 convo_options = convo_options_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1829
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1830 if (option & OPT_CONVO_SHOW_SMILEY)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1411
diff changeset
1831 toggle_smileys();
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1411
diff changeset
1832
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1833 if (option & OPT_CONVO_SHOW_TIME)
1428
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1411
diff changeset
1834 toggle_timestamps();
00b3d02a2168 [gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1411
diff changeset
1835
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1836 if (option & OPT_CONVO_CHECK_SPELLING)
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1837 toggle_spellchk();
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1838
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1839 if (option & OPT_CONVO_COMBINE) {
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2839
diff changeset
1840 /* (OPT_IM_SIDE_TAB | OPT_IM_BR_TAB) == (OPT_CHAT_SIDE_TAB | OPT_CHAT_BR_TAB) */
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1841
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2839
diff changeset
1842 }
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2839
diff changeset
1843
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1844 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1845
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1846 static void set_im_options()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1847 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1848 int option = im_options ^ im_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1849 im_options = im_options_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1850
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1851 if (option & OPT_IM_ONE_WINDOW)
2843
87d11d2a7d59 [gaim-migrate @ 2856]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2839
diff changeset
1852 im_tabize();
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1853
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1854 if (option & OPT_IM_SIDE_TAB || option & OPT_IM_BR_TAB)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1855 update_im_tabs();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1856
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1857 if (option & OPT_IM_HIDE_ICONS)
2323
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2322
diff changeset
1858 set_hide_icons();
bde2481bb4db [gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2322
diff changeset
1859
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1860 if (option & OPT_IM_ALIAS_TAB)
2787
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2760
diff changeset
1861 set_convo_titles();
feea7103a235 [gaim-migrate @ 2800]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2760
diff changeset
1862
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1863 if (option & OPT_IM_NO_ANIMATION)
3013
47d0f8979fb1 [gaim-migrate @ 3026]
Sean Egan <seanegan@gmail.com>
parents: 3012
diff changeset
1864 set_anim();
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 if (option & OPT_IM_BUTTON_TEXT || option & OPT_IM_BUTTON_XPM)
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1867 update_im_button_pix();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1868 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1869
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1870 static void set_chat_options()
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1871 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1872 int option = chat_options ^ chat_options_new;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1873 chat_options = chat_options_new;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1874
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1875 if (option & OPT_CHAT_ONE_WINDOW)
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1876 chat_tabize();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1877
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1878 if (option & OPT_CHAT_BUTTON_TEXT || option & OPT_CHAT_BUTTON_XPM)
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1879 update_chat_button_pix();
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1880 }
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1881
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1882 void set_sound_options()
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1883 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1884 /* int option = sound_options ^ sound_options_new; */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1885 sound_options = sound_options_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1886
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1887 }
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1888
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1889 static void set_font_options()
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1890 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1891 /* int option = font_options ^ font_options_new; */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1892 font_options = font_options_new;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1893
1253
8342d3aab1f1 [gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1250
diff changeset
1894 update_font_buttons();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1895 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1896
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1897 static void set_away_options()
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1455
diff changeset
1898 {
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1899 int option = away_options ^ away_options_new;
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1900 away_options = away_options_new;
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1901
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1902 if (option & OPT_AWAY_QUEUE)
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1903 toggle_away_queue();
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1904 }
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1455
diff changeset
1905
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1906 static void toggle_option(GtkWidget *w, int option) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1907 int *o = gtk_object_get_user_data(GTK_OBJECT(w));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1908 *o ^= option;
1525
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1455
diff changeset
1909 }
ba8e6e211af5 [gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1455
diff changeset
1910
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1911 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
1912 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1913 GtkWidget *button;
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
1914 button = gtk_check_button_new_with_mnemonic(text);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1915 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1916 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1917 gtk_object_set_user_data(GTK_OBJECT(button), options);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1918
3391
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3386
diff changeset
1919 /* So that the debug window happens immediately
412d1035d666 [gaim-migrate @ 3410]
Sean Egan <seanegan@gmail.com>
parents: 3386
diff changeset
1920 * I don't think it should be "preferences," anyway. */
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1921 if (options == &misc_options_new && option == OPT_MISC_DEBUG)
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1922 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_misc_option),
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1923 (int *)option);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1924 else
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1925 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_option),
2313
bd9d403fb15b [gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2282
diff changeset
1926 (int *)option);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1927
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1928 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1929
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1930 return button;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1931 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1932
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1933 void away_list_clicked(GtkWidget *widget, struct away_message *a)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1934 {}
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1935 void default_away_menu_init(GtkWidget *omenu)
3032
d3536105d581 [gaim-migrate @ 3045]
Rob Flynn <gaim@robflynn.com>
parents: 3025
diff changeset
1936 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1937 GtkWidget *menu, *opt;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1938 int index = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1939 GSList *awy = away_messages;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1940 struct away_message *a;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1941
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1942 menu = gtk_menu_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1943
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1944 while (awy) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1945 a = (struct away_message *)awy->data;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1946 opt = gtk_menu_item_new_with_label(a->name);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1947 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_default_away),
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1948 (gpointer)index);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1949 gtk_widget_show(opt);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1950 gtk_menu_append(GTK_MENU(menu), opt);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1951
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1952 awy = awy->next;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1953 index++;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1954 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1955
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1956 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1957 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1958 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
1959 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1960
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1961 GtkWidget *pref_fg_picture = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1962 GtkWidget *pref_bg_picture = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1963
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1964 void destroy_colorsel(GtkWidget *w, gpointer d)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1965 {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1966 if (d) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1967 gtk_widget_destroy(fgcseld);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1968 fgcseld = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1969 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1970 gtk_widget_destroy(bgcseld);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1971 bgcseld = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1972 }
3032
d3536105d581 [gaim-migrate @ 3045]
Rob Flynn <gaim@robflynn.com>
parents: 3025
diff changeset
1973 }
d3536105d581 [gaim-migrate @ 3045]
Rob Flynn <gaim@robflynn.com>
parents: 3025
diff changeset
1974
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1975 void apply_color_dlg(GtkWidget *w, gpointer d)
3032
d3536105d581 [gaim-migrate @ 3045]
Rob Flynn <gaim@robflynn.com>
parents: 3025
diff changeset
1976 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1977 if ((int)d == 1) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1978 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1979 (GTK_COLOR_SELECTION_DIALOG(fgcseld)->colorsel),
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1980 &fgcolor_new);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1981 destroy_colorsel(NULL, (void *)1);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1982 update_color(NULL, pref_fg_picture);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1983 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1984 gtk_color_selection_get_current_color(GTK_COLOR_SELECTION
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1985 (GTK_COLOR_SELECTION_DIALOG(bgcseld)->colorsel),
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1986 &bgcolor_new);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1987 destroy_colorsel(NULL, (void *)0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1988 update_color(NULL, pref_bg_picture);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1989 }
3032
d3536105d581 [gaim-migrate @ 3045]
Rob Flynn <gaim@robflynn.com>
parents: 3025
diff changeset
1990 }
d3536105d581 [gaim-migrate @ 3045]
Rob Flynn <gaim@robflynn.com>
parents: 3025
diff changeset
1991
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1992 void update_color(GtkWidget *w, GtkWidget *pic)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1993 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1994 GdkColor c;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1995 GtkStyle *style;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1996 c.pixel = 0;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
1997
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1998 if (pic == pref_fg_picture) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
1999 if (font_options_new & OPT_FONT_FGCOL) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2000 c.red = fgcolor_new.red;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2001 c.blue = fgcolor_new.blue;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2002 c.green = fgcolor_new.green;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2003 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2004 c.red = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2005 c.blue = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2006 c.green = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2007 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2008 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2009 if (font_options_new & OPT_FONT_BGCOL) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2010 c.red = bgcolor_new.red;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2011 c.blue = bgcolor_new.blue;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2012 c.green = bgcolor_new.green;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2013 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2014 c.red = 0xffff;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2015 c.blue = 0xffff;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2016 c.green = 0xffff;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2017 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2018 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2019
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2020 style = gtk_style_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2021 style->bg[0] = c;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2022 gtk_widget_set_style(pic, style);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2023 gtk_style_unref(style);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2024 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2025 void set_default_away(GtkWidget *w, gpointer i)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2026 {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2027
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2028 int length = g_slist_length(away_messages);
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
2029
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2030 if (away_messages == NULL)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2031 default_away_new = NULL;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2032 else if ((int)i >= length)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2033 default_away_new = g_slist_nth_data(away_messages, length - 1);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2034 else
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2035 default_away_new = g_slist_nth_data(away_messages, (int)i);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2036 }
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2037
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2038 static void update_spin_value(GtkWidget *w, GtkWidget *spin)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2039 {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2040 int *value = gtk_object_get_user_data(GTK_OBJECT(spin));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2041 *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
2042 }
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2043 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
2044 {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2045 GtkWidget *hbox;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2046 GtkWidget *label;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2047 GtkWidget *spin;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2048 GtkObject *adjust;
901
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
2049
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2050 hbox = gtk_hbox_new(FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2051 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2052 gtk_widget_show(hbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2053
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2054 label = gtk_label_new_with_mnemonic(title);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2055 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2056 gtk_widget_show(label);
1881
a02584b98823 [gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1840
diff changeset
2057
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2058 adjust = gtk_adjustment_new(*val, min, max, 1, 1, 1);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2059 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2060 gtk_object_set_user_data(GTK_OBJECT(spin), val);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2061 gtk_widget_set_usize(spin, 50, -1);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2062 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2063 gtk_signal_connect(GTK_OBJECT(adjust), "value-changed",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2064 GTK_SIGNAL_FUNC(update_spin_value), GTK_WIDGET(spin));
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2065 gtk_widget_show(spin);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2066
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2067 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2068
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2069 if (sg) {
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2070 gtk_size_group_add_widget(sg, label);
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2071 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2072
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2073 }
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2074 return label;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2075 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2076
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2077 void dropdown_set(GtkObject *w, int *option)
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2078 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2079 int opt = (int)gtk_object_get_user_data(w);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2080 int clear = (int)gtk_object_get_data(w, "clear");
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2081
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2082 if (clear != -1) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2083 *option = *option & ~clear;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2084 *option = *option | opt;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2085 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2086 debug_printf("HELLO %d\n", opt);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2087 *option = opt;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2088 }
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2089
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2090 if (option == &proxytype_new) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2091 if (opt == PROXY_NONE)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2092 gtk_widget_set_sensitive(prefs_proxy_frame, FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2093 else
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2094 gtk_widget_set_sensitive(prefs_proxy_frame, TRUE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2095 } else if (option == &web_browser_new) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2096 if (opt == BROWSER_MANUAL)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2097 gtk_widget_set_sensitive(browser_entry, TRUE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2098 else
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2099 gtk_widget_set_sensitive(browser_entry, FALSE);
3379
b48b73ef172b [gaim-migrate @ 3398]
Sean Egan <seanegan@gmail.com>
parents: 3377
diff changeset
2100 } else if (*option == sound_options_new) {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2101 if (opt == OPT_SOUND_CMD)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2102 gtk_widget_set_sensitive(sndcmd, TRUE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2103 else
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2104 gtk_widget_set_sensitive(sndcmd, FALSE);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2105 }
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2106
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2107 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2108
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2109 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
2110 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2111 va_list menuitems;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2112 GtkWidget *dropdown, *opt, *menu;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2113 GtkWidget *label;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2114 gchar *text;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2115 int value;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2116 int o = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2117 GtkWidget *hbox;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2118
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2119 hbox = gtk_hbox_new(FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2120 gtk_container_add (GTK_CONTAINER (box), hbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2121 gtk_widget_show(hbox);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2122
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2123 label = gtk_label_new_with_mnemonic(title);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2124 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2125 gtk_widget_show(label);
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 va_start(menuitems, clear);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2128 text = va_arg(menuitems, gchar *);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2129
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2130 if (!text)
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2131 return NULL;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2132
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2133 dropdown = gtk_option_menu_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2134 menu = gtk_menu_new();
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2135
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2136 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown);
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2137
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2138 while (text) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2139 value = va_arg(menuitems, int);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2140 opt = gtk_menu_item_new_with_label(text);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2141 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)value);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2142 gtk_object_set_data(GTK_OBJECT(opt), "clear", (void *)clear);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2143 gtk_signal_connect(GTK_OBJECT(opt), "activate",
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2144 GTK_SIGNAL_FUNC(dropdown_set), (void *)option);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2145 gtk_widget_show(opt);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2146 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2147
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2148 if (((clear > -1) && ((*option & value) == value)) || *option == value) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2149 gtk_menu_set_active(GTK_MENU(menu), o);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2150 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2151 text = va_arg(menuitems, gchar *);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2152 o++;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2153 }
2262
9c8f353331e7 [gaim-migrate @ 2272]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2254
diff changeset
2154
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2155 va_end(menuitems);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2156
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2157 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2158 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2159 gtk_widget_show(dropdown);
3427
8fa61405af2b [gaim-migrate @ 3453]
Sean Egan <seanegan@gmail.com>
parents: 3404
diff changeset
2160 return label;
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2161 }
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2162
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2163 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2164 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2165 /* more stuff stolen from X-Chat */
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2166 GtkWidget *swid;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2167 GdkColor c;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2168 GtkStyle *style;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2169 c.pixel = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2170 if (fgc) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2171 if (font_options_new & OPT_FONT_FGCOL) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2172 c.red = fgcolor_new.red;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2173 c.blue = fgcolor_new.blue;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2174 c.green = fgcolor_new.green;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2175 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2176 c.red = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2177 c.blue = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2178 c.green = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2179 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2180 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2181 if (font_options_new & OPT_FONT_BGCOL) {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2182 c.red = bgcolor_new.red;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2183 c.blue = bgcolor_new.blue;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2184 c.green = bgcolor_new.green;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2185 } else {
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2186 c.red = 0xffff;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2187 c.blue = 0xffff;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2188 c.green = 0xffff;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2189 }
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2190 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2191
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2192 style = gtk_style_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2193 style->bg[0] = c;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2194
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2195 swid = gtk_event_box_new();
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2196 gtk_widget_set_style(GTK_WIDGET(swid), style);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2197 gtk_style_unref(style);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2198 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2199 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2200 gtk_widget_show(swid);
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2201 return swid;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2202 }
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2203 void apply_font_dlg(GtkWidget *w, GtkWidget *f)
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
2204 {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2205 int i = 0;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2206 char *fontname;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2207
3473
0073a014e55b [gaim-migrate @ 3524]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
2208 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
2209 destroy_fontsel(0, 0);
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
2210
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2211 while(fontname[i] && !isdigit(fontname[i]) && i < sizeof(fontface_new)) {
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2212 fontface_new[i] = fontname[i];
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2213 i++;
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2214 }
3473
0073a014e55b [gaim-migrate @ 3524]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
2215 fontface_new[i] = 0;
0073a014e55b [gaim-migrate @ 3524]
Sean Egan <seanegan@gmail.com>
parents: 3472
diff changeset
2216 debug_printf("fontface_new: %s\n", fontface_new);
3366
120e08ea5aee [gaim-migrate @ 3385]
Sean Egan <seanegan@gmail.com>
parents: 3326
diff changeset
2217 g_free(fontname);
1124
a70d5200edde [gaim-migrate @ 1134]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1123
diff changeset
2218 }
3500
b79894c97bed [gaim-migrate @ 3563]
Luke Schierer <lschiere@pidgin.im>
parents: 3485
diff changeset
2219