annotate src/prefs.c @ 748:c32d4fae9bbd

[gaim-migrate @ 758] blargh committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 23 Aug 2000 18:30:35 +0000
parents eec93c5929b9
children bcae3ff49680
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 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
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
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
23 #include "../config.h"
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>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include "proxy.h"
411
a330017b3aa4 [gaim-migrate @ 421]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 378
diff changeset
37 #include "gnome_applet_mgr.h"
588
e2cdcbfdc0b2 [gaim-migrate @ 598]
Rob Flynn <gaim@robflynn.com>
parents: 584
diff changeset
38 #include "pixmaps/cancel.xpm"
595
3fd5311a3894 [gaim-migrate @ 605]
Todd Kulesza <fflewddur>
parents: 588
diff changeset
39 #include "pixmaps/fontface2.xpm"
3fd5311a3894 [gaim-migrate @ 605]
Todd Kulesza <fflewddur>
parents: 588
diff changeset
40 #include "pixmaps/refresh.xpm"
617
50f7a0bc76fc [gaim-migrate @ 627]
Todd Kulesza <fflewddur>
parents: 616
diff changeset
41 #include "pixmaps/gnome_add.xpm"
50f7a0bc76fc [gaim-migrate @ 627]
Todd Kulesza <fflewddur>
parents: 616
diff changeset
42 #include "pixmaps/gnome_remove.xpm"
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
43 #include "pixmaps/palette.xpm"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 struct debug_window *dw = NULL;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
46 static GtkWidget *prefs = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
48 static GtkWidget *gaim_button(const char *, int *, int, GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
49 static void prefs_build_general(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
50 static void prefs_build_connect(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
51 static void prefs_build_buddy(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
52 static void prefs_build_convo(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
53 static void prefs_build_sound(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
54 static void prefs_build_away(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
55 static void prefs_build_browser(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
56 static gint handle_delete(GtkWidget *, GdkEvent *, void *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
57
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
58 static GtkWidget *prefdialog = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
59 static GtkWidget *debugbutton = NULL;
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
60 static GtkWidget *prefrem = NULL;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
61 GtkWidget *prefs_away_list = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
62
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
63 static void destdeb(GtkWidget *m, gpointer n)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
64 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
65 gtk_widget_destroy(debugbutton);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
66 debugbutton = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
67 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
68
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
69 static void remdes(GtkWidget *m, gpointer n)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
70 {
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
71 gtk_widget_destroy(prefrem);
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
72 prefrem = NULL;
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
73 }
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
74
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
75 static void general_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
76 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
77 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
78 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
79 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
80 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
81 GtkWidget *idle;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
82
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
83 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
84 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
85
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
86 prefdialog = gtk_frame_new(_("General Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
87 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
88
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
89 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
90 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
91 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
92
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
93 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
94 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
95 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
96
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
97 prefrem = gaim_button(_("Remember password"), &general_options, OPT_GEN_REMEMBER_PASS, box);
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
98 gtk_signal_connect(GTK_OBJECT(prefrem), "destroy", GTK_SIGNAL_FUNC(remdes), 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
99 gaim_button(_("Auto-login"), &general_options, OPT_GEN_AUTO_LOGIN, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
100
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
101 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
102 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
103 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
104
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
105 gaim_button(_("Use borderless buttons (requires restart for some buttons)"), &display_options, OPT_DISP_COOL_LOOK, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
106 gaim_button(_("Show Buddy Ticker after restart"), &display_options, OPT_DISP_SHOW_BUDDYTICKER, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
107 if (!dw && (general_options & OPT_GEN_DEBUG))
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
108 general_options = general_options ^ OPT_GEN_DEBUG;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
109 debugbutton = gaim_button(_("Show Debug Window"), &general_options, OPT_GEN_DEBUG, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
110 gtk_signal_connect_object(GTK_OBJECT(debugbutton), "clicked", GTK_SIGNAL_FUNC(show_debug), 0);
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
111 gtk_signal_connect(GTK_OBJECT(debugbutton), "destroy", GTK_SIGNAL_FUNC(destdeb), 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
112
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
113 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
114 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
115 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
116
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
117 idle = gaim_button(_("Report Idle Times"), &report_idle, 1, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
118 gtk_signal_connect(GTK_OBJECT(idle), "clicked", set_option, &report_idle);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
119
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
120 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
121 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
122
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
123 static GtkWidget *aim_host_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
124 static GtkWidget *aim_port_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
125 static GtkWidget *login_host_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
126 static GtkWidget *login_port_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
127 static GtkWidget *proxy_host_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
128 static GtkWidget *proxy_port_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
129
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
130 static int connection_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
131 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
132 g_snprintf(aim_host, sizeof(aim_host), "%s", gtk_entry_get_text(GTK_ENTRY(aim_host_entry)));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
133 sscanf(gtk_entry_get_text(GTK_ENTRY(aim_port_entry)), "%d", &aim_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
134 g_snprintf(login_host, sizeof(login_host), "%s", gtk_entry_get_text(GTK_ENTRY(login_host_entry)));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
135 sscanf(gtk_entry_get_text(GTK_ENTRY(login_port_entry)), "%d", &login_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
136 if (proxy_type != PROXY_NONE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
137 g_snprintf(proxy_host, sizeof(proxy_host), "%s", gtk_entry_get_text(GTK_ENTRY(proxy_host_entry)));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
138 sscanf(gtk_entry_get_text(GTK_ENTRY(proxy_port_entry)), "%d", &proxy_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
139 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
140 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
141 return TRUE;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
142 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
143
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
144 static void set_connect(GtkWidget *w, int *data)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
145 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
146 proxy_type = (int)data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
147 if (proxy_type != PROXY_NONE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
148 if (proxy_host_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
149 gtk_widget_set_sensitive(proxy_host_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
150 if (proxy_port_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
151 gtk_widget_set_sensitive(proxy_port_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
152 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
153 if (proxy_host_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
154 gtk_widget_set_sensitive(proxy_host_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
155 if (proxy_port_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
156 gtk_widget_set_sensitive(proxy_port_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
157 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
158
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
159 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
160 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
161
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
162 static GtkWidget *connect_radio(char *label, int which, GtkWidget *box, GtkWidget *set)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
163 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
164 GtkWidget *opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
165
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
166 if (!set)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
167 opt = gtk_radio_button_new_with_label(NULL, label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
168 else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
169 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)), label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
170 gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0);
683
2186b43872b7 [gaim-migrate @ 693]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 682
diff changeset
171 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_connect), (void *)which);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
172 gtk_widget_show(opt);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
173 if (proxy_type == which)
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
174 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
175
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
176 return opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
177 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
178
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
179 static void connect_destroy(GtkWidget *n, gpointer d)
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
180 {
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
181 proxy_host_entry = NULL;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
182 proxy_port_entry = NULL;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
183 }
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
184
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
185 static void connect_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
186 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
187 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
188 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
189 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
190 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
191 GtkWidget *hbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
192 GtkWidget *opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
193 char buffer[1024];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
194
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
195 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
196 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
197
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
198 prefdialog = gtk_frame_new(_("Connection Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
199 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
200 gtk_signal_connect(GTK_OBJECT(prefdialog), "destroy", GTK_SIGNAL_FUNC(connect_destroy), 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
201
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
202 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
203 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
204 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
205
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
206 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
207 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
208 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
209
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
210 gaim_button(_("Use Oscar Protocol (experimental; only takes effect before signon)"), &general_options, OPT_GEN_USE_OSCAR, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
211
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
212 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
213 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
214 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
215
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
216 label = gtk_label_new(_("The following options do not apply if you use Oscar."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
217 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
218 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
219
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
220 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
221 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
222 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
223
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
224 label = gtk_label_new(_("TOC Host:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
225 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
226 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
227
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
228 aim_host_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
229 gtk_box_pack_start(GTK_BOX(hbox), aim_host_entry, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
230 gtk_entry_set_text(GTK_ENTRY(aim_host_entry), aim_host);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
231 gtk_signal_connect(GTK_OBJECT(aim_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
232 gtk_widget_show(aim_host_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
233
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
234 label = gtk_label_new(_("Port:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
235 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
236 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
237
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
238 aim_port_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
239 gtk_box_pack_start(GTK_BOX(hbox), aim_port_entry, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
240 g_snprintf(buffer, sizeof(buffer), "%d", aim_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
241 gtk_entry_set_text(GTK_ENTRY(aim_port_entry), buffer);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
242 gtk_signal_connect(GTK_OBJECT(aim_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
243 gtk_widget_show(aim_port_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
244
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
245 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
246 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
247 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
248
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
249 label = gtk_label_new(_("Login Host:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
250 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
251 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
252
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
253 login_host_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
254 gtk_box_pack_start(GTK_BOX(hbox), login_host_entry, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
255 gtk_entry_set_text(GTK_ENTRY(login_host_entry), login_host);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
256 gtk_signal_connect(GTK_OBJECT(login_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
257 gtk_widget_show(login_host_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
258
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
259 label = gtk_label_new(_("Port:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
260 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
261 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
262
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
263 login_port_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
264 gtk_box_pack_start(GTK_BOX(hbox), login_port_entry, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
265 g_snprintf(buffer, sizeof(buffer), "%d", login_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
266 gtk_entry_set_text(GTK_ENTRY(login_port_entry), buffer);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
267 gtk_signal_connect(GTK_OBJECT(login_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
268 gtk_widget_show(login_port_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
269
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
270 opt = connect_radio(_("No Proxy"), PROXY_NONE, box, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
271 opt = connect_radio(_("HTTP Proxy"), PROXY_HTTP, box, opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
272 opt = connect_radio(_("Socks 4 Proxy"), PROXY_SOCKS4, box, opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
273 opt = connect_radio(_("Socks 5 Proxy"), PROXY_SOCKS5, box, opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
274
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
275 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
276 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
277 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
278
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
279 label = gtk_label_new(_("Proxy Host:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
280 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
281 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
282
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
283 proxy_host_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
284 gtk_box_pack_start(GTK_BOX(hbox), proxy_host_entry, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
285 gtk_entry_set_text(GTK_ENTRY(proxy_host_entry), proxy_host);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
286 gtk_signal_connect(GTK_OBJECT(proxy_host_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
287 gtk_widget_show(proxy_host_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
288
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
289 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
290 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
291 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
292
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
293 label = gtk_label_new(_("Port:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
294 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
295 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
296
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
297 proxy_port_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
298 gtk_box_pack_start(GTK_BOX(hbox), proxy_port_entry, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
299 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
300 gtk_entry_set_text(GTK_ENTRY(proxy_port_entry), buffer);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
301 gtk_signal_connect(GTK_OBJECT(proxy_port_entry), "focus_out_event", GTK_SIGNAL_FUNC(connection_key_pressed), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
302 gtk_widget_show(proxy_port_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
303
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
304 if (proxy_type != PROXY_NONE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
305 gtk_widget_set_sensitive(proxy_host_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
306 gtk_widget_set_sensitive(proxy_port_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
307 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
308 gtk_widget_set_sensitive(proxy_host_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
309 gtk_widget_set_sensitive(proxy_port_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
310 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
311
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
312 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
313 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
314
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
315 static void buddy_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
316 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
317 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
318 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
319 GtkWidget *label;
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
320 GtkWidget *sep;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
321
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
322 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
323 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
324
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
325 prefdialog = gtk_frame_new(_("Buddy List Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
326 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
327
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
328 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
329 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
330 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
331
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
332 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
333 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
334 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
335
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
336 gaim_button(_("Show numbers in groups"), &display_options, OPT_DISP_SHOW_GRPNUM, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
337 gaim_button(_("Show idle times"), &display_options, OPT_DISP_SHOW_IDLETIME, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
338 gaim_button(_("Show buddy type icons"), &display_options, OPT_DISP_SHOW_PIXMAPS, box);
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
339
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
340 sep = gtk_hseparator_new();
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
341 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
342 gtk_widget_show(sep);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
343
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 683
diff changeset
344 gaim_button(_("Hide IM/Info/Chat buttons"), &display_options, OPT_DISP_NO_BUTTONS, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
345 gaim_button(_("Show pictures on buttons"), &display_options, OPT_DISP_SHOW_BUTTON_XPM, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
346 gaim_button(_("Use Daemon pictures"), &display_options, OPT_DISP_DEVIL_PIXMAPS, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
347
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
348 sep = gtk_hseparator_new();
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
349 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
350 gtk_widget_show(sep);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
351
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
352 gaim_button(_("Save Window Size/Position"), &general_options, OPT_GEN_SAVED_WINDOWS, box);
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
353 #ifdef USE_APPLET
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
354 gaim_button(_("Automatically show buddy list on sign on"), &general_options, OPT_GEN_APP_BUDDY_SHOW, box);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
355 #endif
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
356
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
357 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
358 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
359
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
360 static GtkWidget *permtree = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
361
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
362 static void build_deny_tree()
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
363 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
364 GtkWidget *ti;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
365 GtkWidget *sub;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
366 GList *plist = permit;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
367 GList *dlist = deny;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
368
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
369 if (!permtree) return;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
370
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
371 gtk_tree_clear_items(GTK_TREE(permtree), 0, -1);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
372
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
373 ti = gtk_tree_item_new_with_label(_("Permit"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
374 sub = gtk_tree_new();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
375 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
376 gtk_widget_show(sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
377 gtk_tree_prepend(GTK_TREE(permtree), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
378 gtk_tree_item_set_subtree(GTK_TREE_ITEM(ti), sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
379 gtk_tree_item_expand(GTK_TREE_ITEM(ti));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
380
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
381 while(plist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
382 ti = gtk_tree_item_new_with_label((char *)plist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
383 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
384 gtk_tree_prepend(GTK_TREE(sub), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
385 plist = plist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
386 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
387
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
388
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
389 ti = gtk_tree_item_new_with_label(_("Deny"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
390 sub = gtk_tree_new();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
391 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
392 gtk_widget_show(sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
393 gtk_tree_prepend(GTK_TREE(permtree), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
394 gtk_tree_item_set_subtree(GTK_TREE_ITEM(ti), sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
395 gtk_tree_item_expand(GTK_TREE_ITEM(ti));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
396
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
397 while(dlist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
398 ti = gtk_tree_item_new_with_label((char *)dlist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
399 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
400 gtk_tree_prepend(GTK_TREE(sub), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
401 dlist = dlist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
402 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
403 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
404
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
405 static void do_del_perm(GtkWidget *w, GtkTree *ptree)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
406 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
407 GtkLabel *label, *plabel;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
408 GtkWidget *item, *pitem;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
409 char *c, *d;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
410 GList *i;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
411
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
412 GList *plist;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
413 GList *dlist;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
414 int level;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
415
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
416 plist = permit;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
417 dlist = deny;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
418
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
419 i = GTK_TREE_SELECTION(ptree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
420 if (i) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
421 item = GTK_WIDGET(i->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
422 gtk_tree_unselect_child(GTK_TREE(ptree), item);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
423 label = GTK_LABEL(GTK_BIN(item)->child);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
424 gtk_label_get(label, &c);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
425 level = GTK_TREE(item->parent)->level;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
426 if (level > 0) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
427 pitem = GTK_WIDGET(GTK_TREE(item->parent)->tree_owner);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
428 plabel = GTK_LABEL(GTK_BIN(pitem)->child);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
429 gtk_label_get(plabel, &d);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
430 if (!strcasecmp(d, _("Permit"))) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
431 while(plist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
432 if (!strcasecmp((char *)(plist->data), c)) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
433 permit = g_list_remove(permit, plist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
434 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
435 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
436
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
437 plist = plist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
438 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
439
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
440 } else {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
441 while(dlist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
442 if (!strcasecmp((char *)(dlist->data), c)) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
443 deny = g_list_remove(deny, dlist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
444
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
445 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
446 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
447 dlist = dlist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
448 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
449
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
450 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
451
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
452
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
453 } else {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
454 /* Can't delete groups here! :) */
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
455 return;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
456 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
457 serv_set_permit_deny();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
458 gtk_tree_clear_items(GTK_TREE(ptree), 0, -1);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
459 build_permit_tree();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
460 serv_save_config();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
461 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
462 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
463
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
464
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
465 static void set_permit(GtkWidget *w, int *data)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
466 {
682
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
467 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) {
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
468 permdeny = (int)data;
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
469 if (blist) {
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 705
diff changeset
470 do_export(0, 0);
682
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
471 serv_save_config();
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
472 /* we do this here because we can :) */
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
473 serv_set_permit_deny();
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
474 }
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
475 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
476 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
477
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
478 static GtkWidget *deny_radio(char *label, int which, GtkWidget *box, GtkWidget *set)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
479 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
480 GtkWidget *opt;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
481
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
482 if (!set)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
483 opt = gtk_radio_button_new_with_label(NULL, label);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
484 else
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
485 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)), label);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
486 gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
487 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_permit), (void *)which);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
488 gtk_widget_show(opt);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
489 if (permdeny == which)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
490 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
491
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
492 return opt;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
493 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
494
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
495 static void permdest(GtkWidget *m, gpointer n)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
496 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
497 gtk_widget_destroy(permtree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
498 permtree = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
499 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
500
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
501 static void add_perm_callback(GtkWidget *widget, void *dummy)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
502 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
503 if (!blist)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
504 do_error_dialog(_("Please sign on before editing the permit/deny lists."),
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
505 _("Please sign on"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
506 else
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
507 show_add_perm(NULL);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
508 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
509
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
510 static void deny_page()
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
511 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
512 GtkWidget *parent;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
513 GtkWidget *box;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
514 GtkWidget *label;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
515 GtkWidget *sep;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
516 GtkWidget *hbox;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
517 GtkWidget *vbox;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
518 GtkWidget *xbox;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
519 GtkWidget *opt;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
520 GtkWidget *button;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
521
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
522 parent = prefdialog->parent;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
523 gtk_widget_destroy(prefdialog);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
524
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
525 prefdialog = gtk_frame_new(_("Permit/Deny List Options"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
526 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
527
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
528 box = gtk_vbox_new(FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
529 gtk_container_add(GTK_CONTAINER(prefdialog), box);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
530 gtk_widget_show(box);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
531
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
532 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
533 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
534 gtk_widget_show(label);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
535
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
536 sep = gtk_hseparator_new();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
537 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
538 gtk_widget_show(sep);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
539
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
540 label = gtk_label_new(_("The permit/deny configuration will change between users,\n"
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
541 "and changes while you are signed off will not be saved."));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
542 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
543 gtk_widget_show(label);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
544
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
545 hbox = gtk_hbox_new(FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
546 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
547 gtk_widget_show(hbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
548
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
549 vbox = gtk_vbox_new(FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
550 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
551 gtk_widget_show(vbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
552
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
553 opt = deny_radio(_("Allow Anyone"), PERMIT_ALL, vbox, NULL);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
554 #if 0
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
555 /* This doesn't work because TOC doesn't have a PERMIT_BUDDY setting
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
556 * and merging the two would be very difficult at best, most likely
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
557 * impossible. If we can guarantee only Oscar than this is easy */
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
558 opt = deny_radio(_("Allow only users on Buddy List"), PERMIT_BUDDY, vbox, opt);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
559 #endif
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
560 opt = deny_radio(_("Allow only the users in \"Permit\""), PERMIT_SOME, vbox, opt);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
561
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
562 vbox = gtk_vbox_new(FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
563 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
564 gtk_widget_show(vbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
565
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
566 opt = deny_radio(_("Block all users"), PERMIT_NONE, vbox, opt);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
567 opt = deny_radio(_("Block the users in \"Deny\""), DENY_SOME, vbox, opt);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
568
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
569 xbox = gtk_scrolled_window_new(NULL, NULL);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
570 gtk_box_pack_start(GTK_BOX(box), xbox, TRUE, TRUE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
571 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(xbox),
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
572 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
573 gtk_widget_show(xbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
574
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
575 permtree = gtk_tree_new();
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
576 build_deny_tree();
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
577 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(xbox), permtree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
578 gtk_signal_connect(GTK_OBJECT(permtree), "destroy", GTK_SIGNAL_FUNC(permdest), 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
579 gtk_widget_show(permtree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
580
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
581 hbox = gtk_hbox_new(TRUE, 10);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
582 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
583 gtk_widget_show(hbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
584
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
585 button = picture_button(prefs, _("Add"), gnome_add_xpm);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
586 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
587 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(add_perm_callback), NULL);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
588
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
589 button = picture_button(prefs, _("Remove"), gnome_remove_xpm);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
590 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
591 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_del_perm), permtree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
592
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
593 gtk_widget_show(prefdialog);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
594 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
595
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
596 void build_permit_tree()
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
597 {
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
598 if (permtree)
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
599 deny_page();
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
600 }
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
601
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
602 static void convo_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
603 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
604 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
605 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
606 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
607 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
608
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
609 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
610 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
611
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
612 prefdialog = gtk_frame_new(_("Conversation Window Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
613 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
614
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
615 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
616 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
617 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
618
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
619 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
620 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
621 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
622
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
623 gaim_button(_("Enter sends message"), &general_options, OPT_GEN_ENTER_SENDS, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
624 gaim_button(_("Control-{B/I/U/S} inserts HTML tags"), &general_options, OPT_GEN_CTL_CHARS, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
625
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
626 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
627 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
628 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
629
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
630 gaim_button(_("Show graphical smileys"), &display_options, OPT_DISP_SHOW_SMILEY, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
631 gaim_button(_("Ignore incoming colors"), &display_options, OPT_DISP_IGNORE_COLOUR, box);
667
45ed2ca0756e [gaim-migrate @ 677]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 666
diff changeset
632 gaim_button(_("Ignore white backgrounds"), &display_options, OPT_DISP_IGN_WHITE, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
633 gaim_button(_("Show timestamp on messages"), &display_options, OPT_DISP_SHOW_TIME, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
634
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
635 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
636 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
637 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
638
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
639 gaim_button(_("Log all conversations"), &general_options, OPT_GEN_LOG_ALL, box);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
640 gaim_button(_("Strip HTML from logs"), &general_options, OPT_GEN_STRIP_HTML, box);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
641
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
642 sep = gtk_hseparator_new();
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
643 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
644 gtk_widget_show(sep);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
645
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
646 gaim_button(_("Highlight misspelled words"), &general_options, OPT_GEN_CHECK_SPELLING, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
647 gaim_button(_("Show URLs as links"), &general_options, OPT_GEN_SEND_LINKS, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
648 gaim_button(_("Sending messages removes away status"), &general_options, OPT_GEN_BACK_ON_IM, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
649
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
650 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
651 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
653 static void im_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
654 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
655 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
656 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
657 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
658
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
659 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
660 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
661
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
662 prefdialog = gtk_frame_new(_("IM Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
663 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
664
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
665 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
666 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
667 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
668
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
669 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
670 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
671 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
672
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
673 gaim_button(_("Show logins in window"), &display_options, OPT_DISP_SHOW_LOGON, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
674 gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_WINDOWS, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
675 gaim_button(_("Ignore new conversations when away"), &general_options, OPT_GEN_DISCARD_WHEN_AWAY, box);
736
d05d746384a7 [gaim-migrate @ 746]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 735
diff changeset
676 gaim_button(_("Ignore TiK Automated Messages"), &general_options, OPT_GEN_TIK_HACK, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
677
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
678 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
679 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
680
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
681 static void chat_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
682 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
683 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
684 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
685 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
686
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
687 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
688 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
689
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
690 prefdialog = gtk_frame_new(_("Chat Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
691 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
692
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
693 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
694 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
695 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
696
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
697 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
698 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
699 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
700
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
701 gaim_button(_("Show people joining/leaving in window"), &display_options, OPT_DISP_CHAT_LOGON, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
702 gaim_button(_("Raise windows on events"), &general_options, OPT_GEN_POPUP_CHAT, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
703
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
704 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
705 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
706
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
707 struct chat_page {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
708 GtkWidget *list1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
709 GtkWidget *list2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
710 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
711
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
712 static struct chat_page *cp = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
713
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
714 static void refresh_list(GtkWidget *w, gpointer *m)
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
715 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
716 char *text = grab_url("http://www.aol.com/community/chat/allchats.html");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
717 char *c;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
718 int len = strlen(text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
719 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
720 GList *items = GTK_LIST(cp->list1)->children;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
721 struct chat_room *cr;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
722 c = text;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
723
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
724 while(items) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
725 g_free(gtk_object_get_user_data(GTK_OBJECT(items->data)));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
726 items = items->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
727 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
728
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
729 items = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
730
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
731 gtk_list_clear_items(GTK_LIST(cp->list1), 0, -1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
732
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
733 item = gtk_list_item_new_with_label(_("Gaim Chat"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
734 cr = g_new0(struct chat_room, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
735 strcpy(cr->name, _("Gaim Chat"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
736 cr->exchange = 4;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
737 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
738 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
739
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
740 items = g_list_append(NULL, item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
741
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
742 while(c) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
743 if (c - text > len - 30)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
744 break; /* assume no chat rooms 30 from end, padding */
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
745 if (!strncasecmp(AOL_SRCHSTR, c, strlen(AOL_SRCHSTR))) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
746 char *t;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
747 int len=0;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
748 int exchange;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
749 char *name = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
750
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
751 c += strlen(AOL_SRCHSTR);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
752 t = c;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
753 while(t) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
754 len++;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
755 name = g_realloc(name, len);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
756 if (*t == '+')
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
757 name[len - 1] = ' ';
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
758 else if (*t == '&') {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
759 name[len - 1] = 0;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
760 sscanf(t, "&Exchange=%d", &exchange);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
761 c = t + strlen("&Exchange=x");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
762 break;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
763 } else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
764 name[len - 1] = *t;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
765 t++;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
766 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
767 cr = g_new0(struct chat_room, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
768 strcpy(cr->name, name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
769 cr->exchange = exchange;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
770 item = gtk_list_item_new_with_label(name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
771 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
772 items = g_list_append(items, item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
773 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
774 g_free(name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
775 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
776 c++;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
777 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
778 gtk_list_append_items(GTK_LIST(cp->list1), items);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
779 g_free(text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
780 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
782 static void add_chat(GtkWidget *w, gpointer *m)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
784 GList *sel = GTK_LIST(cp->list1)->selection;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
785 struct chat_room *cr, *cr2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
786 GList *crs = chat_rooms;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
787 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
788
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
789 if (sel) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
790 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(sel->data));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
791 } else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
792 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
793
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
794 while(crs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
795 cr2 = (struct chat_room *)crs->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
796 if (!strcasecmp(cr->name, cr2->name))
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
797 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
798 crs = crs->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
799 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
800 item = gtk_list_item_new_with_label(cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
801 cr2 = g_new0(struct chat_room, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
802 strcpy(cr2->name, cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
803 cr2->exchange = cr->exchange;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
804 gtk_object_set_user_data(GTK_OBJECT(item), cr2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
805 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
806 sel = g_list_append(NULL, item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
807 gtk_list_append_items(GTK_LIST(cp->list2), sel);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
808 chat_rooms = g_list_append(chat_rooms, cr2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
809
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
810 setup_buddy_chats();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
811 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
812
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
813
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
814 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
815
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
816 static void remove_chat(GtkWidget *w, gpointer *m)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
817 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
818 GList *sel = GTK_LIST(cp->list2)->selection;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
819 struct chat_room *cr;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
820 GList *crs;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
821 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
822
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
823 if (sel) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
824 item = (GtkWidget *)sel->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
825 cr = (struct chat_room *)gtk_object_get_user_data(GTK_OBJECT(item));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
826 } else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
827 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
828
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
829 chat_rooms = g_list_remove(chat_rooms, cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
830
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
831
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
832 gtk_list_clear_items(GTK_LIST(cp->list2), 0, -1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
833
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
834 if (g_list_length(chat_rooms) == 0)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
835 chat_rooms = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
836
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
837 crs = chat_rooms;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
838
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
839 while(crs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
840 cr = (struct chat_room *)crs->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
841 item = gtk_list_item_new_with_label(cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
842 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
843 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
844 gtk_list_append_items(GTK_LIST(cp->list2), g_list_append(NULL, item));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
845
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
846
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
847 crs = crs->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
848 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
849
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
850 setup_buddy_chats();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
851 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
852 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
853
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
854 static void room_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
855 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
856 GtkWidget *table;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
857 GtkWidget *rem_button, *add_button, *ref_button;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
858 GtkWidget *list1, *list2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
859 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
860 GtkWidget *sw1, *sw2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
861 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
862 GList *crs = chat_rooms;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
863 GList *items = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
864 struct chat_room *cr;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
865
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
866 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
867 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
868
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
869 if (!cp)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
870 g_free(cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
871 cp = g_new0(struct chat_page, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
872
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
873 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
874 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
875
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
876 prefdialog = gtk_frame_new(_("Chat Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
877 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
878
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
879 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
880 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
881 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
882
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
883 table = gtk_table_new(4, 2, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
884 gtk_widget_show(table);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
885
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
886 gtk_box_pack_start(GTK_BOX(box), table, TRUE, TRUE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
887
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
888 list1 = gtk_list_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
889 list2 = gtk_list_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
890 sw1 = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
891 sw2 = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
892
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
893 ref_button = picture_button(prefs, _("Refresh"), refresh_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
894 add_button = picture_button(prefs, _("Add"), gnome_add_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
895 rem_button = picture_button(prefs, _("Remove"), gnome_remove_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
896 gtk_widget_show(list1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
897 gtk_widget_show(sw1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
898 gtk_widget_show(list2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
899 gtk_widget_show(sw2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
900
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
901 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
902 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
903
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
904 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw1),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
905 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
906 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
907 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
908
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
909 cp->list1 = list1;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
910 cp->list2 = list2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
911
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
912 gtk_signal_connect(GTK_OBJECT(ref_button), "clicked",
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
913 GTK_SIGNAL_FUNC(refresh_list), cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
914 gtk_signal_connect(GTK_OBJECT(rem_button), "clicked",
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
915 GTK_SIGNAL_FUNC(remove_chat), cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
916 gtk_signal_connect(GTK_OBJECT(add_button), "clicked",
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
917 GTK_SIGNAL_FUNC(add_chat), cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
918
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
919
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
920
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
921 label = gtk_label_new(_("List of available chats"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
922 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
923
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
924 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
925 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
926 gtk_table_attach(GTK_TABLE(table), ref_button, 0, 1, 1, 2,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
927 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
928 gtk_table_attach(GTK_TABLE(table), sw1, 0, 1, 2, 3,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
929 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
930 5, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
931 gtk_table_attach(GTK_TABLE(table), add_button, 0, 1, 3, 4,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
932 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
933
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
934
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
935 label = gtk_label_new(_("List of subscribed chats"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
936 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
937
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
938 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
939 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
940 gtk_table_attach(GTK_TABLE(table), sw2, 1, 2, 2, 3,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
941 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
942 5, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
943 gtk_table_attach(GTK_TABLE(table), rem_button, 1, 2, 3, 4,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
944 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
945
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
946
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
947 item = gtk_list_item_new_with_label(_("Gaim Chat"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
948 cr = g_new0(struct chat_room, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
949 strcpy(cr->name, _("Gaim Chat"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
950 cr->exchange = 4;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
951 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
952 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
953 gtk_list_append_items(GTK_LIST(list1), g_list_append(NULL, item));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
954
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
955
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
956 while(crs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
957 cr = (struct chat_room *)crs->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
958 item = gtk_list_item_new_with_label(cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
959 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
960 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
961 items = g_list_append(items, item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
962
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
963 crs = crs->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
964 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
965
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
966 gtk_list_append_items(GTK_LIST(list2), items);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
967
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
968 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
969 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
970
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
971 static void font_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
972 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
973 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
974 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
975 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
976 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
977 GtkWidget *hbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
978 GtkWidget *button;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
979 GtkWidget *select;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
980
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
981 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
982 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
983
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
984 prefdialog = gtk_frame_new(_("Font Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
985 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
986
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
987 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
988 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
989 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
990
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
991 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
992 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
993 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
994
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
995 gaim_button(_("Bold Text"), &font_options, OPT_FONT_BOLD, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
996 gaim_button(_("Italics Text"), &font_options, OPT_FONT_ITALIC, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
997 gaim_button(_("Underlined Text"), &font_options, OPT_FONT_UNDERLINE, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
998 gaim_button(_("Strike Text"), &font_options, OPT_FONT_STRIKE, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
999
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1000 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1001 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1002 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1003
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1004 hbox = gtk_hbox_new(FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1005 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1006 gtk_widget_show(hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1007
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1008 button = gaim_button(_("Text Color"), &font_options, OPT_FONT_FGCOL, hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1009
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1010 select = picture_button(prefs, _("Select"), palette_xpm);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1011 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1012 if (!(font_options & OPT_FONT_FGCOL))
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1013 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1014 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_color_dialog), (void *)1);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1015 gtk_widget_show(select);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1016
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1017 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1018
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1019 hbox = gtk_hbox_new(FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1020 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1021 gtk_widget_show(hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1022
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1023 button = gaim_button(_("Background Color"), &font_options, OPT_FONT_BGCOL, hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1024
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1025 select = picture_button(prefs, _("Select"), palette_xpm);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1026 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1027 if (!(font_options & OPT_FONT_BGCOL))
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1028 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1029 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_color_dialog), (void *)2);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1030 gtk_widget_show(select);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1031
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1032 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1033
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1034 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1035 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1036 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1037
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1038 hbox = gtk_hbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1039 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1040 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1041
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1042 button = gaim_button(_("Font Face for Text"), &font_options, OPT_FONT_FACE, hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1043
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1044 select = picture_button(prefs, _("Select"), fontface2_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1045 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1046 if (!(font_options & OPT_FONT_FACE))
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1047 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1048 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1049 gtk_widget_show(select);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1050
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1051 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1052
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1053 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1054 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1055
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1056 static void sound_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1057 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1058 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1059 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1060 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1061
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1062 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1063 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1064
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1065 prefdialog = gtk_frame_new(_("Sound Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1066 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1067
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1068 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1069 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1070 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1071
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1072 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1073 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1074 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1075
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1076 #ifdef USE_GNOME
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1077 gaim_button(_("Sounds go through GNOME"), &sound_options, OPT_SOUND_THROUGH_GNOME, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1078 #endif
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1079 gaim_button(_("No sounds when you log in"), &sound_options, OPT_SOUND_SILENT_SIGNON, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1080 gaim_button(_("Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1081
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1082 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1083 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1084
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1085 static void event_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1086 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1087 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1088 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1089 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1090 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1091
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1092 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1093 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1094
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1095 prefdialog = gtk_frame_new(_("Sound Events"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1096 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1097
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1098 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1099 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1100 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1101
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1102 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1103 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1104 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1105
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1106 gaim_button(_("Sound when buddy logs in"), &sound_options, OPT_SOUND_LOGIN, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1107 gaim_button(_("Sound when buddy logs out"), &sound_options, OPT_SOUND_LOGOUT, box);
723
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1108
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1109 sep = gtk_hseparator_new();
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1110 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1111 gtk_widget_show(sep);
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1112
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1113 gaim_button(_("Sound when message is received"), &sound_options, OPT_SOUND_RECV, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1114 gaim_button(_("Sound when message is first received"), &sound_options, OPT_SOUND_FIRST_RCV, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1115 gaim_button(_("Sound when message is sent"), &sound_options, OPT_SOUND_SEND, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1116
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1117 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1118 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1119 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1120
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1121 gaim_button(_("Sound in chat rooms when people enter/leave"), &sound_options, OPT_SOUND_CHAT_JOIN, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1122 gaim_button(_("Sound in chat rooms when people talk"), &sound_options, OPT_SOUND_CHAT_SAY, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1123
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1124 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1125 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1126
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1127 static struct away_message *cur_message;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1128 static char *edited_message;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1129 static GtkWidget *away_text;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1130
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1131 void away_list_clicked(GtkWidget *widget, struct away_message *a)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1132 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1133 gchar buffer[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1134 guint text_len;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1135
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1136 cur_message = a;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1137
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1138 /* Get proper Length */
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1139 text_len = gtk_text_get_length(GTK_TEXT(away_text));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1140 edited_message = gtk_editable_get_chars(GTK_EDITABLE(away_text), 0, text_len);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1141
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1142 /* Clear the Box */
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1143 gtk_text_set_point(GTK_TEXT(away_text), 0 );
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1144 gtk_text_forward_delete (GTK_TEXT(away_text), text_len);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1145
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1146 /* Fill the text box with new message */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1147 strcpy(buffer, a->message);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1148 gtk_text_insert(GTK_TEXT(away_text), NULL, NULL, NULL, buffer, -1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1149 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1150
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1151 void away_list_unclicked(GtkWidget *widget, struct away_message *a)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1152 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1153 if (prefs_away_list == NULL)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1154 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1155 strcpy(a->message, edited_message);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1156 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1157 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1158
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1159 void remove_away_message(GtkWidget *widget, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1160 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1161 GList *i;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1162 struct away_message *a;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1163
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1164 i = GTK_LIST(prefs_away_list)->selection;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1165
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1166 a = gtk_object_get_user_data(GTK_OBJECT(i->data));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1167
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1168 rem_away_mess(NULL, a);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1169 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1170
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1171 static void paldest(GtkWidget *m, gpointer n)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1172 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1173 gtk_widget_destroy(prefs_away_list);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1174 prefs_away_list = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1175 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1176
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1177 static void away_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1178 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1179 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1180 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1181 GtkWidget *top;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1182 GtkWidget *bot;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1183 GtkWidget *sw;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1184 GtkWidget *sw2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1185 GtkWidget *button;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1186 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1187 GtkWidget *list_item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1188 GList *awy = away_messages;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1189 struct away_message *a;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1190 char buffer[BUF_LONG];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1191
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1192 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1193 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1194
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1195 prefdialog = gtk_frame_new(_("Away Messages"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1196 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1197
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1198 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1199 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1200 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1201
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1202 top = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1203 gtk_box_pack_start(GTK_BOX(box), top, TRUE, TRUE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1204 gtk_widget_show(top);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1205
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1206 sw = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1207 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1208 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1209 gtk_box_pack_start(GTK_BOX(top), sw, TRUE, TRUE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1210 gtk_widget_show(sw);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1211
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1212 prefs_away_list = gtk_list_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1213 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw), prefs_away_list);
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1214 gtk_signal_connect(GTK_OBJECT(prefs_away_list), "destroy", GTK_SIGNAL_FUNC(paldest), 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1215 gtk_widget_show(prefs_away_list);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1216
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1217 sw2 = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1218 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1219 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1220 gtk_box_pack_start(GTK_BOX(top), sw2, TRUE, TRUE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1221 gtk_widget_show(sw2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1222
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1223 away_text = gtk_text_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1224 gtk_container_add(GTK_CONTAINER(sw2), away_text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1225 gtk_text_set_word_wrap(GTK_TEXT(away_text), TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1226 gtk_text_set_editable(GTK_TEXT(away_text), TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1227 gtk_widget_show(away_text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1228
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1229 bot = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1230 gtk_box_pack_start(GTK_BOX(box), bot, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1231 gtk_widget_show(bot);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1232
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1233 button = picture_button(prefs, _("Add"), gnome_add_xpm);
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
1234 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), button);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1235 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1236
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1237 button = picture_button(prefs, _("Remove"), gnome_remove_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1238 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(remove_away_message), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1239 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1240
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1241 if (awy != NULL) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1242 a = (struct away_message *)awy->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1243 g_snprintf(buffer, sizeof(buffer), "%s", a->message);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1244 gtk_text_insert(GTK_TEXT(away_text), NULL, NULL, NULL, buffer, -1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1245 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1246
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1247 while (awy) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1248 a = (struct away_message *)awy->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1249 label = gtk_label_new(a->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1250 list_item = gtk_list_item_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1251 gtk_container_add(GTK_CONTAINER(list_item), label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1252 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(away_list_clicked), a);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1253 gtk_signal_connect(GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(away_list_unclicked), a);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1254 gtk_object_set_user_data(GTK_OBJECT(list_item), a);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1255
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1256 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1257 gtk_container_add(GTK_CONTAINER(prefs_away_list), list_item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1258 gtk_widget_show(list_item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1259
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1260 awy = awy->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1261 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1262
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1263 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1264 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1265
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1266 static GtkWidget *browser_entry = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1267 static GtkWidget *new_window = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1268
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1269 static void set_browser(GtkWidget *w, int *data)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1270 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1271 web_browser = (int)data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1272 if (web_browser != BROWSER_MANUAL) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1273 if (browser_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1274 gtk_widget_set_sensitive(browser_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1275 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1276 if (browser_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1277 gtk_widget_set_sensitive(browser_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1278 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1279
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1280 if (web_browser != BROWSER_NETSCAPE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1281 if (new_window)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1282 gtk_widget_set_sensitive(new_window, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1283 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1284 if (new_window)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1285 gtk_widget_set_sensitive(new_window, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1286 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1287
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1288
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1289 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1290 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1291
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1292 static int manualentry_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1293 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1294 g_snprintf(web_command, sizeof(web_command), "%s", gtk_entry_get_text(GTK_ENTRY(browser_entry)));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1295 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1296 return TRUE;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1297 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1298
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1299 static GtkWidget *browser_radio(char *label, int which, GtkWidget *box, GtkWidget *set)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1300 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1301 GtkWidget *opt;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1302
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1303 if (!set)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1304 opt = gtk_radio_button_new_with_label(NULL, label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1305 else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1306 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)), label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1307 gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1308 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(set_browser), (void *)which);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1309 gtk_widget_show(opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1310 if (web_browser == which)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1311 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1312
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1313 return opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1314 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1315
748
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1316 static void brentdes(GtkWidget *m, gpointer n)
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1317 {
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1318 browser_entry = NULL;
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1319 new_window = NULL;
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1320 }
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1321
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1322 static void browser_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1323 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1324 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1325 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1326 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1327 GtkWidget *opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1328
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1329 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1330 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1331 prefs_away_list = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1332
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1333 prefdialog = gtk_frame_new(_("Browser Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1334 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1335
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1336 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1337 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1338 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1339
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1340 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1341 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1342 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1343
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1344 opt = browser_radio(_("Netscape"), BROWSER_NETSCAPE, box, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1345 opt = browser_radio(_("KFM"), BROWSER_KFM, box, opt);
734
a42e259c423f [gaim-migrate @ 744]
Rob Flynn <gaim@robflynn.com>
parents: 733
diff changeset
1346 #ifdef USE_GNOME
a42e259c423f [gaim-migrate @ 744]
Rob Flynn <gaim@robflynn.com>
parents: 733
diff changeset
1347 opt = browser_radio(_("GNOME URL Handler"), BROWSER_GNOME, box, opt);
a42e259c423f [gaim-migrate @ 744]
Rob Flynn <gaim@robflynn.com>
parents: 733
diff changeset
1348 #endif /* USE_GNOME */
735
51f1b6f7794b [gaim-migrate @ 745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 734
diff changeset
1349 opt = browser_radio(_("Internal HTML Widget (Quite likely a bad idea!)"), BROWSER_INTERNAL, box, opt);
51f1b6f7794b [gaim-migrate @ 745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 734
diff changeset
1350 opt = browser_radio(_("Manual"), BROWSER_MANUAL, box, opt);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1351
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1352 browser_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1353 gtk_box_pack_start(GTK_BOX(box), browser_entry, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1354 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1355 gtk_signal_connect(GTK_OBJECT(browser_entry), "focus_out_event", GTK_SIGNAL_FUNC(manualentry_key_pressed), NULL);
748
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1356 gtk_signal_connect(GTK_OBJECT(browser_entry), "destroy", GTK_SIGNAL_FUNC(brentdes), NULL);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1357 gtk_widget_show(browser_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1358
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1359 new_window = gaim_button(_("Pop up new window by default"), &general_options, OPT_GEN_BROWSER_POPUP, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1360
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1361 if (web_browser != BROWSER_MANUAL) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1362 gtk_widget_set_sensitive(browser_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1363 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1364 gtk_widget_set_sensitive(browser_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1365 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1366
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1367 if (web_browser != BROWSER_NETSCAPE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1368 gtk_widget_set_sensitive(new_window, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1369 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1370 gtk_widget_set_sensitive(new_window, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1371 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1372
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1373 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1374 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1375
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1376 static void try_me(GtkCTree *ctree, GtkCTreeNode *node)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1377 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1378 /* this is a hack */
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1379 void (*func)();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1380 func = gtk_ctree_node_get_row_data(ctree, node);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1381 (*func)();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1382 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1383
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1384 void show_prefs()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1385 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1386 GtkWidget *vbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1387 GtkWidget *hpaned;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1388 GtkWidget *scroll;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1389 GtkWidget *preftree;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1390 GtkWidget *container;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1391 GtkWidget *hbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1392 GtkWidget *close;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1393
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1394 if (prefs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1395 gtk_widget_show(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1396 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1397 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1398
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1399 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1400 gtk_widget_realize(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1401 aol_icon(prefs->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1402 gtk_container_border_width(GTK_CONTAINER(prefs), 10);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1403 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences"));
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 667
diff changeset
1404 gtk_widget_set_usize(prefs, 600, 440);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1405
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1406 vbox = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1407 gtk_container_add(GTK_CONTAINER(prefs), vbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1408 gtk_widget_show(vbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1409
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1410 hpaned = gtk_hpaned_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1411 gtk_box_pack_start(GTK_BOX(vbox), hpaned, TRUE, TRUE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1412 gtk_widget_show(hpaned);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1413
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1414 scroll = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1415 gtk_paned_pack1(GTK_PANED(hpaned), scroll, TRUE, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1416 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1417 GTK_POLICY_NEVER, GTK_POLICY_NEVER);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1418 gtk_widget_set_usize(scroll, 125, -1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1419 gtk_widget_show(scroll);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1420
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1421 preftree = gtk_ctree_new(1, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1422 gtk_ctree_set_line_style (GTK_CTREE(preftree), GTK_CTREE_LINES_SOLID);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1423 gtk_ctree_set_expander_style(GTK_CTREE(preftree), GTK_CTREE_EXPANDER_TRIANGLE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1424 gtk_clist_set_reorderable(GTK_CLIST(preftree), FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1425 gtk_container_add(GTK_CONTAINER(scroll), preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1426 gtk_signal_connect(GTK_OBJECT(preftree), "tree_select_row", GTK_SIGNAL_FUNC(try_me), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1427 gtk_widget_show(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1428
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1429 prefs_build_general(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1430 prefs_build_connect(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1431 prefs_build_buddy(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1432 prefs_build_convo(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1433 prefs_build_sound(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1434 prefs_build_away(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1435 prefs_build_browser(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1436
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1437 container = gtk_frame_new(NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1438 gtk_container_set_border_width(GTK_CONTAINER(container), 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1439 gtk_frame_set_shadow_type(GTK_FRAME(container), GTK_SHADOW_NONE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1440 gtk_paned_pack2(GTK_PANED(hpaned), container, TRUE, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1441 gtk_widget_show(container);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1442
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1443 prefdialog = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1444 gtk_container_add(GTK_CONTAINER(container), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1445 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1446
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1447 general_page();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1448
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1449 hbox = gtk_hbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1450 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1451 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1452
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1453 close = picture_button(prefs, _("Close"), cancel_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1454 gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1455 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(handle_delete), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1456
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1457 gtk_widget_show(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1458 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1459
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1460 char debug_buff[BUF_LONG];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1461
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1462 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1463 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1464 if (debugbutton)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1465 gtk_button_clicked(GTK_BUTTON(debugbutton));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1466 if (general_options & OPT_GEN_DEBUG)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1467 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1468 general_options = general_options ^ (int)OPT_GEN_DEBUG;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1469 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1470 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1471 g_free(dw);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1472 dw=NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1473 return FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1474
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1475 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1476
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1477 static void build_debug()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1478 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1479 GtkWidget *scroll;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1480 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1481 if (!dw)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1482 dw = g_new0(struct debug_window, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1483
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1484 box = gtk_hbox_new(FALSE,0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1485 dw->window = gtk_window_new(GTK_WINDOW_DIALOG);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1486 gtk_window_set_title(GTK_WINDOW(dw->window), _("GAIM debug output window"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1487 gtk_container_add(GTK_CONTAINER(dw->window), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1488 dw->entry = gtk_text_new(NULL,NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1489 gtk_widget_set_usize(dw->entry, 500, 200);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1490 scroll = gtk_vscrollbar_new(GTK_TEXT(dw->entry)->vadj);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1491 gtk_box_pack_start(GTK_BOX(box), dw->entry, TRUE,TRUE,0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1492 gtk_box_pack_end(GTK_BOX(box), scroll,FALSE,FALSE,0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1493 gtk_widget_show(dw->entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1494 gtk_widget_show(scroll);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1495 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1496 gtk_signal_connect(GTK_OBJECT(dw->window),"delete_event", GTK_SIGNAL_FUNC(debug_delete), NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1497 gtk_widget_show(dw->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1498 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1499
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1500 void show_debug(GtkObject *obj)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1501 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1502 if((general_options & OPT_GEN_DEBUG)) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1503 if(!dw || !dw->window)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1504 build_debug();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1505 gtk_widget_show(dw->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1506 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1507 if (!dw) return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1508 gtk_widget_destroy(dw->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1509 dw->window = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1510 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1511 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1512
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1513 void debug_print(char *chars)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1514 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1515 if (general_options & OPT_GEN_DEBUG && dw)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1516 gtk_text_insert(GTK_TEXT(dw->entry), NULL, NULL, NULL, chars, strlen(chars));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1517 #ifdef DEBUG
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1518 printf("%s\n", chars);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1519 #endif
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
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1522 static gint handle_delete(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1523 {
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1524 save_prefs();
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1525
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1526 if (cp)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1527 g_free(cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1528 cp = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1529
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1530 if (event == NULL)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1531 gtk_widget_destroy(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1532 prefs = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1533 prefdialog = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1534 debugbutton = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1535
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1536 return FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1537 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1538
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1539 void set_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1540 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1541 *option = !(*option);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1542 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1543
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1544 void set_general_option(GtkWidget *w, int *option)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1545 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1546 general_options = general_options ^ (int)option;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1547
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1548 if ((int)option == OPT_GEN_LOG_ALL)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1549 update_log_convs();
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1550
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1551 if (prefrem)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1552 gtk_signal_handler_block_by_data(GTK_OBJECT(prefrem), (int *)OPT_GEN_REMEMBER_PASS);
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1553 if (remember)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1554 gtk_signal_handler_block_by_data(GTK_OBJECT(remember), (int *)OPT_GEN_REMEMBER_PASS);
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1555 if (prefrem)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1556 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(prefrem),
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1557 (general_options & OPT_GEN_REMEMBER_PASS));
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1558 if (remember)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1559 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(remember),
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1560 (general_options & OPT_GEN_REMEMBER_PASS));
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1561 if (prefrem)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1562 gtk_signal_handler_unblock_by_data(GTK_OBJECT(prefrem), (int *)OPT_GEN_REMEMBER_PASS);
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1563 if (remember)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1564 gtk_signal_handler_unblock_by_data(GTK_OBJECT(remember), (int *)OPT_GEN_REMEMBER_PASS);
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1565
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1566 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1567 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1568
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1569 void set_display_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1570 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1571 display_options = display_options ^ (int)option;
9
effb8a20de26 [gaim-migrate @ 18]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
1572
701
8a9e9e694ba4 [gaim-migrate @ 711]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 696
diff changeset
1573 if (blist) build_imchat_box(!(display_options & OPT_DISP_NO_BUTTONS));
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 683
diff changeset
1574
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 10
diff changeset
1575 if (blist) update_button_pix();
9
effb8a20de26 [gaim-migrate @ 18]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
1576
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 82
diff changeset
1577 #ifdef USE_APPLET
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 18
diff changeset
1578 update_pixmaps();
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 18
diff changeset
1579 #endif
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1580
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1581 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1582 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1583
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1584 void set_sound_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1585 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1586 sound_options = sound_options ^ (int)option;
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1587 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1588 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1589
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1590 void set_font_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1591 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1592 font_options = font_options ^ (int)option;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1593
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1594 update_font_buttons();
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1595
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1596 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1597 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1598
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1599 GtkWidget *gaim_button(const char *text, int *options, int option, GtkWidget *page)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1600 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1601 GtkWidget *button;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1602 button = gtk_check_button_new_with_label(text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1603 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1604 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1605
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1606 if (options == &font_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1607 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_font_option), (int *)option);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1608
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1609 if (options == &sound_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1610 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_sound_option), (int *)option);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1611 if (options == &display_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1612 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_display_option), (int *)option);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1613
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1614 if (options == &general_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1615 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_general_option), (int *)option);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1616 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1617
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1618 return button;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1619 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1620
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1621 void prefs_build_general(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1622 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1623 GtkCTreeNode *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1624 char *text[1];
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1625
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1626 text[0] = _("General");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1627 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1628 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1629 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, general_page);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1630 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1631
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1632 void prefs_build_connect(GtkWidget *preftree)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1633 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1634 GtkCTreeNode *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1635 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1636
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1637 text[0] = _("Connection");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1638 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1639 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1640 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, connect_page);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1641 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1642
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1643 void prefs_build_buddy(GtkWidget *preftree)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1644 {
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1645 GtkCTreeNode *parent, *node;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1646 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1647
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1648 text[0] = _("Buddy List");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1649 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1650 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1651 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, buddy_page);
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1652
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1653 /* FIXME ! We shouldn't be showing this if we're not signed on */
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1654 text[0] = _("Permit/Deny");
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1655 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1656 text, 5, NULL, NULL, NULL, NULL, 0, 1);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1657 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, deny_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1658 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1659
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1660 void prefs_build_convo(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1661 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1662 GtkCTreeNode *parent, *node, *node2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1663 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1664
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1665 text[0] = _("Conversations");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1666 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1667 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1668 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, convo_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1669
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1670 text[0] = _("IM Window");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1671 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1672 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1673 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, im_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1674
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1675 text[0] = _("Chat Window");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1676 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1677 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1678 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, chat_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1679
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1680 text[0] = _("Chat Rooms");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1681 node2 = gtk_ctree_insert_node(GTK_CTREE(preftree), node, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1682 text, 5, NULL, NULL, NULL, NULL, 1, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1683 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node2, room_page);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1684
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1685 text[0] = _("Font Options");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1686 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1687 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1688 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, font_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1689 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1690
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1691 void prefs_build_sound(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1692 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1693 GtkCTreeNode *parent, *node;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1694 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1695
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1696 text[0] = _("Sounds");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1697 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1698 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1699 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, sound_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1700
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1701 text[0] = _("Events");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1702 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1703 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1704 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, event_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1705 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1706
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1707 void prefs_build_away(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1708 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1709 GtkCTreeNode *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1710 char *text[1];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1711
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1712 text[0] = _("Away Messages");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1713 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1714 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1715 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, away_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1716 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1717
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1718 void prefs_build_browser(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1719 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1720 GtkCTreeNode *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1721 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1722
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1723 text[0] = _("Browser");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1724 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1725 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1726 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, browser_page);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1727 }