annotate src/prefs.c @ 935:5e6ca3dd4d02

[gaim-migrate @ 945] yay. thanks bmiller committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 22 Sep 2000 10:16:40 +0000
parents a88af4cc626a
children 9fca1293f871
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"
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
43 #include "pixmaps/gnome_preferences.xpm"
855
82673bb41e2f [gaim-migrate @ 865]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
44 #include "pixmaps/bgcolor.xpm"
82673bb41e2f [gaim-migrate @ 865]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
45 #include "pixmaps/fgcolor.xpm"
821
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
46 #include "pixmaps/save.xpm"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 struct debug_window *dw = NULL;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
49 static GtkWidget *prefs = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
51 static GtkWidget *gaim_button(const char *, int *, int, GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
52 static void prefs_build_general(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
53 static void prefs_build_connect(GtkWidget *);
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
54 #ifdef USE_APPLET
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
55 static void prefs_build_applet(GtkWidget *);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
56 #endif
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
57 static void prefs_build_buddy(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
58 static void prefs_build_convo(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
59 static void prefs_build_sound(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
60 static void prefs_build_away(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
61 static void prefs_build_browser(GtkWidget *);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
62 static gint handle_delete(GtkWidget *, GdkEvent *, void *);
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
63 static void delete_prefs(GtkWidget *, void *);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
64
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
65 static GtkWidget *prefdialog = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
66 static GtkWidget *debugbutton = NULL;
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
67 static GtkWidget *prefrem = NULL;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
68 GtkWidget *prefs_away_list = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
69
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
70 static void destdeb(GtkWidget *m, gpointer n)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
71 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
72 gtk_widget_destroy(debugbutton);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
73 debugbutton = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
74 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
75
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
76 static void remdes(GtkWidget *m, gpointer n)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
77 {
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
78 gtk_widget_destroy(prefrem);
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
79 prefrem = NULL;
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
80 }
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
81
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
82 static void general_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
83 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
84 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
85 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
86 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
87 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
88 GtkWidget *idle;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
89
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
90 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
91 gtk_widget_destroy(prefdialog);
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 prefdialog = gtk_frame_new(_("General Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
94 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
95
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
96 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
97 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
98 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
99
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
100 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
101 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
102 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
103
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
104 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
105 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
106 gaim_button(_("Auto-login"), &general_options, OPT_GEN_AUTO_LOGIN, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
107
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
108 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
109 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
110 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
111
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
112 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
113 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
114 if (!dw && (general_options & OPT_GEN_DEBUG))
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
115 general_options = general_options ^ OPT_GEN_DEBUG;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
116 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
117 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
118 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
119
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
120 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
121 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
122 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
123
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
124 idle = gaim_button(_("Report Idle Times"), &report_idle, 1, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
125 gtk_signal_connect(GTK_OBJECT(idle), "clicked", set_option, &report_idle);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
126
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
127 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
128 }
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 GtkWidget *aim_host_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
131 static GtkWidget *aim_port_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
132 static GtkWidget *login_host_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
133 static GtkWidget *login_port_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
134 static GtkWidget *proxy_host_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
135 static GtkWidget *proxy_port_entry;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
136
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
137 static int connection_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
138 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
139 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
140 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
141 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
142 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
143 if (proxy_type != PROXY_NONE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
144 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
145 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
146 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
147 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
148 return TRUE;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
149 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
150
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
151 static void set_connect(GtkWidget *w, int *data)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
152 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
153 proxy_type = (int)data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
154 if (proxy_type != PROXY_NONE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
155 if (proxy_host_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
156 gtk_widget_set_sensitive(proxy_host_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
157 if (proxy_port_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
158 gtk_widget_set_sensitive(proxy_port_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
159 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
160 if (proxy_host_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
161 gtk_widget_set_sensitive(proxy_host_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
162 if (proxy_port_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
163 gtk_widget_set_sensitive(proxy_port_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
164 }
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 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
167 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
168
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
169 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
170 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
171 GtkWidget *opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
172
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
173 if (!set)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
174 opt = gtk_radio_button_new_with_label(NULL, label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
175 else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
176 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
177 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
178 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
179 gtk_widget_show(opt);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
180 if (proxy_type == which)
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
181 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
182
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
183 return opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
184 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
185
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
186 static void connect_destroy(GtkWidget *n, gpointer d)
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
187 {
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
188 proxy_host_entry = NULL;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
189 proxy_port_entry = NULL;
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
190 }
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
191
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
192 static void connect_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
193 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
194 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
195 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
196 GtkWidget *label;
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
197 GtkWidget *sep;
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
198
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
199 parent = prefdialog->parent;
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
200 gtk_widget_destroy(prefdialog);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
201
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
202 prefdialog = gtk_frame_new(_("Connection Options"));
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
203 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
204 gtk_signal_connect(GTK_OBJECT(prefdialog), "destroy", GTK_SIGNAL_FUNC(connect_destroy), 0);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
205
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
206 box = gtk_vbox_new(FALSE, 5);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
207 gtk_container_add(GTK_CONTAINER(prefdialog), box);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
208 gtk_widget_show(box);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
209
893
93385c6fc772 [gaim-migrate @ 903]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 891
diff changeset
210 label = gtk_label_new(_("AOL has two protocols for connecting to AIM. One of them is Oscar and the other is TOC.\n\nTOC is a published protocol; AOL allows people to use the TOC protocol in their clients to connect. It is a simplified version of Oscar; it is capable of most tasks, but cannot perform all of the functions of Oscar. Because TOC is published, using TOC in gaim tends to be more stable and reliable.\n\nOscar is a proprietary protocol. AOL has not published any information about it. Gaim is able to use Oscar thanks to libfaim, which reverse-engineered the Oscar protocol and is able to emulate it. While libfaim has not decoded or implemented all of the functions of Oscar, it is still able to perform most functions TOC provides as well as several others. However, using Oscar in gaim tends to be less reliable, though more usable.\n\nChanging this option takes effect at signon time."));
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
211 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
212 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
213 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
214 gtk_widget_show(label);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
215
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
216 gaim_button(_("Use Oscar Protocol"), &general_options, OPT_GEN_USE_OSCAR, box);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
217
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
218 sep = gtk_hseparator_new();
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
219 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
220 gtk_widget_show(sep);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
221
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
222 gaim_button(_("Send Keep-Alive Packet (6 bytes/minute)"), &general_options, OPT_GEN_KEEPALIVE, box);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
223
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
224 gtk_widget_show(prefdialog);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
225 }
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
226
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
227 static void toc_page()
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
228 {
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
229 GtkWidget *parent;
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
230 GtkWidget *box;
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
231 GtkWidget *label;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
232 GtkWidget *hbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
233 GtkWidget *opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
234 char buffer[1024];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
235
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
236 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
237 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
238
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
239 prefdialog = gtk_frame_new(_("TOC Options"));
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
240 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
241 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
242
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
243 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
244 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
245 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
246
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
247 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
248 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
249 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
250
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
251 label = gtk_label_new(_("TOC Host:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
252 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
253 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
254
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
255 aim_host_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
256 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
257 gtk_entry_set_text(GTK_ENTRY(aim_host_entry), aim_host);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
258 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
259 gtk_widget_show(aim_host_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
260
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
261 label = gtk_label_new(_("Port:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
262 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
263 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
264
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
265 aim_port_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
266 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
267 g_snprintf(buffer, sizeof(buffer), "%d", aim_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
268 gtk_entry_set_text(GTK_ENTRY(aim_port_entry), buffer);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
269 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
270 gtk_widget_show(aim_port_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
271
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
272 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
273 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
274 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
275
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
276 label = gtk_label_new(_("Login Host:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
277 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
278 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
279
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
280 login_host_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
281 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
282 gtk_entry_set_text(GTK_ENTRY(login_host_entry), login_host);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
283 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
284 gtk_widget_show(login_host_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
285
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
286 label = gtk_label_new(_("Port:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
287 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
288 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
289
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
290 login_port_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
291 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
292 g_snprintf(buffer, sizeof(buffer), "%d", login_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
293 gtk_entry_set_text(GTK_ENTRY(login_port_entry), buffer);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
294 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
295 gtk_widget_show(login_port_entry);
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 opt = connect_radio(_("No Proxy"), PROXY_NONE, box, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
298 opt = connect_radio(_("HTTP Proxy"), PROXY_HTTP, box, opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
299 opt = connect_radio(_("Socks 4 Proxy"), PROXY_SOCKS4, box, opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
300 opt = connect_radio(_("Socks 5 Proxy"), PROXY_SOCKS5, box, opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
301
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
302 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
303 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
304 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
305
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
306 label = gtk_label_new(_("Proxy Host:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
307 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
308 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
309
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
310 proxy_host_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
311 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
312 gtk_entry_set_text(GTK_ENTRY(proxy_host_entry), proxy_host);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
313 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
314 gtk_widget_show(proxy_host_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
315
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
316 hbox = gtk_hbox_new(FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
317 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
318 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
319
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
320 label = gtk_label_new(_("Port:"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
321 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
322 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
323
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
324 proxy_port_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
325 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
326 g_snprintf(buffer, sizeof(buffer), "%d", proxy_port);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
327 gtk_entry_set_text(GTK_ENTRY(proxy_port_entry), buffer);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
328 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
329 gtk_widget_show(proxy_port_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
330
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
331 if (proxy_type != PROXY_NONE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
332 gtk_widget_set_sensitive(proxy_host_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
333 gtk_widget_set_sensitive(proxy_port_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
334 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
335 gtk_widget_set_sensitive(proxy_host_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
336 gtk_widget_set_sensitive(proxy_port_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
337 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
338
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
339 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
340 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
341
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
342 static void oscar_page()
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
343 {
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
344 GtkWidget *parent;
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
345 GtkWidget *box;
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
346 GtkWidget *label;
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
347
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
348 parent = prefdialog->parent;
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
349 gtk_widget_destroy(prefdialog);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
350
902
bd5f4997f063 [gaim-migrate @ 912]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 901
diff changeset
351 prefdialog = gtk_frame_new(_("Oscar Options"));
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
352 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
353
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
354 box = gtk_vbox_new(FALSE, 5);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
355 gtk_container_add(GTK_CONTAINER(prefdialog), box);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
356 gtk_widget_show(box);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
357
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
358 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
359 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
360 gtk_widget_show(label);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
361
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
362 label = gtk_label_new(_("No options currently (Isn't that sad)"));
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
363 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
364 gtk_widget_show(label);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
365
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
366 gtk_widget_show(prefdialog);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
367 }
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
368
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
369 #ifdef USE_APPLET
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
370 static void applet_page()
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
371 {
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
372 GtkWidget *parent;
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
373 GtkWidget *box;
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
374 GtkWidget *label;
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
375 GtkWidget *sep;
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
376
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
377 parent = prefdialog->parent;
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
378 gtk_widget_destroy(prefdialog);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
379
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
380 prefdialog = gtk_frame_new(_("Applet Options"));
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
381 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
382
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
383 box = gtk_vbox_new(FALSE, 5);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
384 gtk_container_add(GTK_CONTAINER(prefdialog), box);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
385 gtk_widget_show(box);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
386
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
387 label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
388 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
389 gtk_widget_show(label);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
390
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
391 gaim_button(_("Display Buddy List near applet"), &general_options, OPT_GEN_NEAR_APPLET, box);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
392
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
393 gtk_widget_show(prefdialog);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
394 }
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
395 #endif
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
396
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
397 static void buddy_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
398 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
399 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
400 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
401 GtkWidget *label;
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
402 GtkWidget *sep;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
403
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
404 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
405 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
406
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
407 prefdialog = gtk_frame_new(_("Buddy List Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
408 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
409
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
410 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
411 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
412 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
413
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
414 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
415 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
416 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
417
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
418 gaim_button(_("Show numbers in groups"), &display_options, OPT_DISP_SHOW_GRPNUM, box);
902
bd5f4997f063 [gaim-migrate @ 912]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 901
diff changeset
419 gaim_button(_("Hide groups with no online buddies"), &display_options, OPT_DISP_NO_MT_GRP, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
420 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
421 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
422
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
423 sep = gtk_hseparator_new();
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
424 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
425 gtk_widget_show(sep);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
426
696
97b75ed155b0 [gaim-migrate @ 706]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 683
diff changeset
427 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
428 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
429
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
430 sep = gtk_hseparator_new();
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
431 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
432 gtk_widget_show(sep);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
433
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
434 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
435 #ifdef USE_APPLET
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 736
diff changeset
436 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
437 #endif
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
438
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
439 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
440 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
441
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
442 static GtkWidget *permtree = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
443
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
444 static void build_deny_tree()
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
445 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
446 GtkWidget *ti;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
447 GtkWidget *sub;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
448 GList *plist = permit;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
449 GList *dlist = deny;
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 if (!permtree) return;
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 gtk_tree_clear_items(GTK_TREE(permtree), 0, -1);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
454
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
455 ti = gtk_tree_item_new_with_label(_("Permit"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
456 sub = gtk_tree_new();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
457 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
458 gtk_widget_show(sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
459 gtk_tree_prepend(GTK_TREE(permtree), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
460 gtk_tree_item_set_subtree(GTK_TREE_ITEM(ti), sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
461 gtk_tree_item_expand(GTK_TREE_ITEM(ti));
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 while(plist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
464 ti = gtk_tree_item_new_with_label((char *)plist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
465 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
466 gtk_tree_prepend(GTK_TREE(sub), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
467 plist = plist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
468 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
469
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
470
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
471 ti = gtk_tree_item_new_with_label(_("Deny"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
472 sub = gtk_tree_new();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
473 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
474 gtk_widget_show(sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
475 gtk_tree_prepend(GTK_TREE(permtree), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
476 gtk_tree_item_set_subtree(GTK_TREE_ITEM(ti), sub);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
477 gtk_tree_item_expand(GTK_TREE_ITEM(ti));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
478
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
479 while(dlist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
480 ti = gtk_tree_item_new_with_label((char *)dlist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
481 gtk_widget_show(ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
482 gtk_tree_prepend(GTK_TREE(sub), ti);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
483 dlist = dlist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
484 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
485 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
486
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
487 static void do_del_perm(GtkWidget *w, GtkTree *ptree)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
488 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
489 GtkLabel *label, *plabel;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
490 GtkWidget *item, *pitem;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
491 char *c, *d;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
492 GList *i;
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 GList *plist;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
495 GList *dlist;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
496 int level;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
497
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
498 plist = permit;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
499 dlist = deny;
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 i = GTK_TREE_SELECTION(ptree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
502 if (i) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
503 item = GTK_WIDGET(i->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
504 gtk_tree_unselect_child(GTK_TREE(ptree), item);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
505 label = GTK_LABEL(GTK_BIN(item)->child);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
506 gtk_label_get(label, &c);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
507 level = GTK_TREE(item->parent)->level;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
508 if (level > 0) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
509 pitem = GTK_WIDGET(GTK_TREE(item->parent)->tree_owner);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
510 plabel = GTK_LABEL(GTK_BIN(pitem)->child);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
511 gtk_label_get(plabel, &d);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
512 if (!strcasecmp(d, _("Permit"))) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
513 while(plist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
514 if (!strcasecmp((char *)(plist->data), c)) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
515 permit = g_list_remove(permit, plist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
516 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
517 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
518
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
519 plist = plist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
520 }
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 } else {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
523 while(dlist) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
524 if (!strcasecmp((char *)(dlist->data), c)) {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
525 deny = g_list_remove(deny, dlist->data);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
526
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
527 break;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
528 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
529 dlist = dlist->next;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
530 }
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 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
533
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
534
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
535 } else {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
536 /* Can't delete groups here! :) */
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
537 return;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
538 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
539 serv_set_permit_deny();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
540 gtk_tree_clear_items(GTK_TREE(ptree), 0, -1);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
541 build_permit_tree();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
542 serv_save_config();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
543 }
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
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
546
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
547 static void set_permit(GtkWidget *w, int *data)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
548 {
682
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
549 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) {
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
550 permdeny = (int)data;
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
551 if (blist) {
710
efd72a117875 [gaim-migrate @ 720]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 705
diff changeset
552 do_export(0, 0);
682
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
553 serv_save_config();
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
554 /* we do this here because we can :) */
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
555 serv_set_permit_deny();
9b189d028b34 [gaim-migrate @ 692]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 679
diff changeset
556 }
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
557 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
558 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
559
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
560 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
561 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
562 GtkWidget *opt;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
563
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
564 if (!set)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
565 opt = gtk_radio_button_new_with_label(NULL, label);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
566 else
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
567 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
568 gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
569 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
570 gtk_widget_show(opt);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
571 if (permdeny == which)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
572 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
573
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
574 return opt;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
575 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
576
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
577 static void permdest(GtkWidget *m, gpointer n)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
578 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
579 gtk_widget_destroy(permtree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
580 permtree = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
581 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
582
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
583 static void add_perm_callback(GtkWidget *widget, void *dummy)
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 if (!blist)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
586 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
587 _("Please sign on"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
588 else
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
589 show_add_perm(NULL);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
590 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
591
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
592 static void deny_page()
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
593 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
594 GtkWidget *parent;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
595 GtkWidget *box;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
596 GtkWidget *label;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
597 GtkWidget *sep;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
598 GtkWidget *hbox;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
599 GtkWidget *vbox;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
600 GtkWidget *xbox;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
601 GtkWidget *opt;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
602 GtkWidget *button;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
603
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
604 parent = prefdialog->parent;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
605 gtk_widget_destroy(prefdialog);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
606
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
607 prefdialog = gtk_frame_new(_("Permit/Deny List Options"));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
608 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
609
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
610 box = gtk_vbox_new(FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
611 gtk_container_add(GTK_CONTAINER(prefdialog), box);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
612 gtk_widget_show(box);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
613
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
614 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
615 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
616 gtk_widget_show(label);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
617
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
618 sep = gtk_hseparator_new();
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
619 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
620 gtk_widget_show(sep);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
621
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
622 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
623 "and changes while you are signed off will not be saved."));
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
624 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
625 gtk_widget_show(label);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
626
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
627 hbox = gtk_hbox_new(FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
628 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
629 gtk_widget_show(hbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
630
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
631 vbox = gtk_vbox_new(FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
632 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
633 gtk_widget_show(vbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
634
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
635 opt = deny_radio(_("Allow Anyone"), PERMIT_ALL, vbox, NULL);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
636 #if 0
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
637 /* 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
638 * 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
639 * impossible. If we can guarantee only Oscar than this is easy */
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
640 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
641 #endif
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
642 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
643
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
644 vbox = gtk_vbox_new(FALSE, 0);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
645 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
646 gtk_widget_show(vbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
647
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
648 opt = deny_radio(_("Block all users"), PERMIT_NONE, vbox, opt);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
649 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
650
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
651 xbox = gtk_scrolled_window_new(NULL, NULL);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
652 gtk_box_pack_start(GTK_BOX(box), xbox, TRUE, TRUE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
653 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(xbox),
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
654 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
655 gtk_widget_show(xbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
656
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
657 permtree = gtk_tree_new();
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
658 build_deny_tree();
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
659 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(xbox), permtree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
660 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
661 gtk_widget_show(permtree);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
662
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
663 hbox = gtk_hbox_new(TRUE, 10);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
664 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
665 gtk_widget_show(hbox);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
666
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
667 button = picture_button(prefs, _("Add"), gnome_add_xpm);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
668 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
669 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
670
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
671 button = picture_button(prefs, _("Remove"), gnome_remove_xpm);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
672 gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
673 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
674
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
675 gtk_widget_show(prefdialog);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
676 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
677
679
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
678 void build_permit_tree()
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
679 {
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
680 if (permtree)
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
681 deny_page();
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
682 }
71b2477033cb [gaim-migrate @ 689]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 678
diff changeset
683
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
684 static void convo_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
685 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
686 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
687 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
688 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
689 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
690
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
691 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
692 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
693
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
694 prefdialog = gtk_frame_new(_("Conversation Window Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
695 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
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 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
698 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
699 gtk_widget_show(box);
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 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
702 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
703 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
704
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
705 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
706 gaim_button(_("Control-{B/I/U/S} inserts HTML tags"), &general_options, OPT_GEN_CTL_CHARS, box);
830
60284aef22f0 [gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 822
diff changeset
707 gaim_button(_("Control-(number) inserts smileys"), &general_options, OPT_GEN_CTL_SMILEYS, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
708
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
709 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
710 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
711 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
712
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
713 gaim_button(_("Show graphical smileys"), &display_options, OPT_DISP_SHOW_SMILEY, box);
754
bcae3ff49680 [gaim-migrate @ 764]
Rob Flynn <gaim@robflynn.com>
parents: 748
diff changeset
714 gaim_button(_("Show timestamp on messages"), &display_options, OPT_DISP_SHOW_TIME, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
715 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
716 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
717
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
718 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
719 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
720 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
721
702
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
722 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
723 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
724
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
725 sep = gtk_hseparator_new();
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
726 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
727 gtk_widget_show(sep);
056ed55962e0 [gaim-migrate @ 712]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 701
diff changeset
728
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
729 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
730 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
731 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
732
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
733 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
734 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
735
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
736 static void set_buttons_opt(GtkWidget *w, int data)
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
737 {
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
738 int mask;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
739 if (data & 0x1) /* set the first bit if we're affecting chat buttons */
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
740 mask = (OPT_DISP_CHAT_BUTTON_TEXT | OPT_DISP_CHAT_BUTTON_XPM);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
741 else
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
742 mask = (OPT_DISP_CONV_BUTTON_TEXT | OPT_DISP_CONV_BUTTON_XPM);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
743 display_options &= ~(mask);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
744 display_options |= (data & mask);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
745
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
746 if (data & 0x1)
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
747 update_chat_button_pix();
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
748 else
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
749 update_im_button_pix();
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
750 }
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
751
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
752 static void im_buttons_menu_init(GtkWidget *omenu)
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
753 {
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
754 GtkWidget *menu, *opt;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
755 int index;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
756
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
757 switch (display_options &
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
758 (OPT_DISP_CONV_BUTTON_TEXT | OPT_DISP_CONV_BUTTON_XPM)) {
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
759 case OPT_DISP_CONV_BUTTON_TEXT:
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
760 index = 2;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
761 break;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
762 case OPT_DISP_CONV_BUTTON_XPM:
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
763 index = 1;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
764 break;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
765 default: /* both or neither */
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
766 index = 0;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
767 break;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
768 }
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
769
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
770 menu = gtk_menu_new();
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
771
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
772 opt = gtk_menu_item_new_with_label(_("Pictures and Text"));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
773 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_buttons_opt), (void *)(OPT_DISP_CONV_BUTTON_TEXT | OPT_DISP_CONV_BUTTON_XPM));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
774 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
775 gtk_menu_append(GTK_MENU(menu), opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
776
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
777 opt = gtk_menu_item_new_with_label(_("Pictures Only"));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
778 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_buttons_opt), (void *)OPT_DISP_CONV_BUTTON_XPM);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
779 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
780 gtk_menu_append(GTK_MENU(menu), opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
781
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
782 opt = gtk_menu_item_new_with_label(_("Text Only"));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
783 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_buttons_opt), (void *)OPT_DISP_CONV_BUTTON_TEXT);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
784 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
785 gtk_menu_append(GTK_MENU(menu), opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
786
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
787 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
788 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
789 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), index);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
790 }
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
791
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
792 static void im_page()
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 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
795 GtkWidget *box;
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
796 GtkWidget *hbox;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
797 GtkWidget *label;
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
798 GtkWidget *opt;
652
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 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
801 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
802
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
803 prefdialog = gtk_frame_new(_("IM Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
804 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
805
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
806 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
807 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
808 gtk_widget_show(box);
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 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
811 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
812 gtk_widget_show(label);
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 gaim_button(_("Show logins in window"), &display_options, OPT_DISP_SHOW_LOGON, box);
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
815
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
816 hbox = gtk_hbox_new(FALSE, 0);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
817 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
818 gtk_widget_show(hbox);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
819
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
820 label = gtk_label_new(_("Show buttons as "));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
821 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
822 gtk_widget_show(label);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
823
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
824 opt = gtk_option_menu_new();
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
825 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 5);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
826 im_buttons_menu_init(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
827 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
828
864
4a6ab6995439 [gaim-migrate @ 874]
Rob Flynn <gaim@robflynn.com>
parents: 858
diff changeset
829 gaim_button(_("Show larger entry box on new windows"), &display_options, OPT_DISP_CONV_BIG_ENTRY, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
830 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
831 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
832 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
833
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
834 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
835 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
836
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
837 static void chat_buttons_menu_init(GtkWidget *omenu)
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
838 {
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
839 GtkWidget *menu, *opt;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
840 int index;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
841
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
842 switch (display_options &
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
843 (OPT_DISP_CHAT_BUTTON_TEXT | OPT_DISP_CHAT_BUTTON_XPM)) {
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
844 case OPT_DISP_CHAT_BUTTON_TEXT:
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
845 index = 2;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
846 break;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
847 case OPT_DISP_CHAT_BUTTON_XPM:
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
848 index = 1;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
849 break;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
850 default: /* both or neither */
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
851 index = 0;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
852 break;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
853 }
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
854
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
855 menu = gtk_menu_new();
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
856
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
857 opt = gtk_menu_item_new_with_label(_("Pictures and Text"));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
858 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_buttons_opt), (void *)(OPT_DISP_CHAT_BUTTON_TEXT | OPT_DISP_CHAT_BUTTON_XPM | 1));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
859 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
860 gtk_menu_append(GTK_MENU(menu), opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
861
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
862 opt = gtk_menu_item_new_with_label(_("Pictures Only"));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
863 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_buttons_opt), (void *)(OPT_DISP_CHAT_BUTTON_XPM | 1));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
864 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
865 gtk_menu_append(GTK_MENU(menu), opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
866
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
867 opt = gtk_menu_item_new_with_label(_("Text Only"));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
868 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(set_buttons_opt), (void *)(OPT_DISP_CHAT_BUTTON_TEXT | 1));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
869 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
870 gtk_menu_append(GTK_MENU(menu), opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
871
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
872 gtk_option_menu_remove_menu(GTK_OPTION_MENU(omenu));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
873 gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
874 gtk_option_menu_set_history(GTK_OPTION_MENU(omenu), index);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
875 }
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
876
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
877 static void chat_page()
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 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
880 GtkWidget *box;
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
881 GtkWidget *hbox;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
882 GtkWidget *label;
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
883 GtkWidget *opt;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
884
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
885 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
886 gtk_widget_destroy(prefdialog);
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 prefdialog = gtk_frame_new(_("Chat Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
889 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
890
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
891 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
892 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
893 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
894
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
895 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
896 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
897 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
898
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
899 gaim_button(_("Show people joining/leaving in window"), &display_options, OPT_DISP_CHAT_LOGON, box);
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
900
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
901 hbox = gtk_hbox_new(FALSE, 0);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
902 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
903 gtk_widget_show(hbox);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
904
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
905 label = gtk_label_new(_("Show buttons as "));
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
906 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
907 gtk_widget_show(label);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
908
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
909 opt = gtk_option_menu_new();
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
910 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 5);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
911 chat_buttons_menu_init(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
912 gtk_widget_show(opt);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
913
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
914
864
4a6ab6995439 [gaim-migrate @ 874]
Rob Flynn <gaim@robflynn.com>
parents: 858
diff changeset
915 gaim_button(_("Show larger entry box on new windows"), &display_options, OPT_DISP_CHAT_BIG_ENTRY, box);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
916 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
917
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
918 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
919 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
920
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
921 struct chat_page {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
922 GtkWidget *list1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
923 GtkWidget *list2;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
924 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
925
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
926 static struct chat_page *cp = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
927
747
eec93c5929b9 [gaim-migrate @ 757]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
928 static void refresh_list(GtkWidget *w, gpointer *m)
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
929 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
930 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
931 char *c;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
932 int len = strlen(text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
933 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
934 GList *items = GTK_LIST(cp->list1)->children;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
935 struct chat_room *cr;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
936 c = text;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
937
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
938 while(items) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
939 g_free(gtk_object_get_user_data(GTK_OBJECT(items->data)));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
940 items = items->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
941 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
942
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
943 items = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
944
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
945 gtk_list_clear_items(GTK_LIST(cp->list1), 0, -1);
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
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
954 items = g_list_append(NULL, item);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
956 while(c) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
957 if (c - text > len - 30)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
958 break; /* assume no chat rooms 30 from end, padding */
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
959 if (!strncasecmp(AOL_SRCHSTR, c, strlen(AOL_SRCHSTR))) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
960 char *t;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
961 int len=0;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
962 int exchange;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
963 char *name = NULL;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
964
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
965 c += strlen(AOL_SRCHSTR);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
966 t = c;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
967 while(t) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
968 len++;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
969 name = g_realloc(name, len);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
970 if (*t == '+')
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
971 name[len - 1] = ' ';
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
972 else if (*t == '&') {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
973 name[len - 1] = 0;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
974 sscanf(t, "&Exchange=%d", &exchange);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
975 c = t + strlen("&Exchange=x");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
976 break;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
977 } else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
978 name[len - 1] = *t;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
979 t++;
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 cr = g_new0(struct chat_room, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
982 strcpy(cr->name, name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
983 cr->exchange = exchange;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
984 item = gtk_list_item_new_with_label(name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
985 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
986 items = g_list_append(items, item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
987 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
988 g_free(name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
989 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
990 c++;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
991 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
992 gtk_list_append_items(GTK_LIST(cp->list1), items);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
993 g_free(text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
994 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
995
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
996 static void add_chat(GtkWidget *w, gpointer *m)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
997 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
998 GList *sel = GTK_LIST(cp->list1)->selection;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
999 struct chat_room *cr, *cr2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1000 GList *crs = chat_rooms;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1001 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1002
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1003 if (sel) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1004 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
1005 } else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1006 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1007
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1008 while(crs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1009 cr2 = (struct chat_room *)crs->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1010 if (!strcasecmp(cr->name, cr2->name))
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1011 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1012 crs = crs->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1013 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1014 item = gtk_list_item_new_with_label(cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1015 cr2 = g_new0(struct chat_room, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1016 strcpy(cr2->name, cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1017 cr2->exchange = cr->exchange;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1018 gtk_object_set_user_data(GTK_OBJECT(item), cr2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1019 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1020 sel = g_list_append(NULL, item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1021 gtk_list_append_items(GTK_LIST(cp->list2), sel);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1022 chat_rooms = g_list_append(chat_rooms, cr2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1023
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1024 setup_buddy_chats();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1025 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1026
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1027
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1028 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1029
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1030 static void remove_chat(GtkWidget *w, gpointer *m)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1031 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1032 GList *sel = GTK_LIST(cp->list2)->selection;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1033 struct chat_room *cr;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1034 GList *crs;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1035 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1036
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1037 if (sel) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1038 item = (GtkWidget *)sel->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1039 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
1040 } else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1041 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1042
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1043 chat_rooms = g_list_remove(chat_rooms, cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1044
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1045
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1046 gtk_list_clear_items(GTK_LIST(cp->list2), 0, -1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1047
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1048 if (g_list_length(chat_rooms) == 0)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1049 chat_rooms = NULL;
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 crs = chat_rooms;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1052
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1053 while(crs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1054 cr = (struct chat_room *)crs->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1055 item = gtk_list_item_new_with_label(cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1056 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1057 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1058 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
1059
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1060
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1061 crs = crs->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1062 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1063
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1064 setup_buddy_chats();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1065 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1066 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1067
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1068 static void room_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1069 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1070 GtkWidget *table;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1071 GtkWidget *rem_button, *add_button, *ref_button;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1072 GtkWidget *list1, *list2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1073 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1074 GtkWidget *sw1, *sw2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1075 GtkWidget *item;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1076 GList *crs = chat_rooms;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1077 GList *items = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1078 struct chat_room *cr;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1079
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1080 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1081 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1082
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1083 if (!cp)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1084 g_free(cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1085 cp = g_new0(struct chat_page, 1);
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 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1088 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1089
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1090 prefdialog = gtk_frame_new(_("Chat Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1091 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1092
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1093 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1094 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1095 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1096
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1097 table = gtk_table_new(4, 2, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1098 gtk_widget_show(table);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1099
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1100 gtk_box_pack_start(GTK_BOX(box), table, TRUE, TRUE, 0);
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 list1 = gtk_list_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1103 list2 = gtk_list_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1104 sw1 = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1105 sw2 = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1106
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1107 ref_button = picture_button(prefs, _("Refresh"), refresh_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1108 add_button = picture_button(prefs, _("Add"), gnome_add_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1109 rem_button = picture_button(prefs, _("Remove"), gnome_remove_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1110 gtk_widget_show(list1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1111 gtk_widget_show(sw1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1112 gtk_widget_show(list2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1113 gtk_widget_show(sw2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1114
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1115 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw1), list1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1116 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1117
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1118 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw1),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1119 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1120 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1121 GTK_POLICY_AUTOMATIC,GTK_POLICY_ALWAYS);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1122
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1123 cp->list1 = list1;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1124 cp->list2 = list2;
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 gtk_signal_connect(GTK_OBJECT(ref_button), "clicked",
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1127 GTK_SIGNAL_FUNC(refresh_list), cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1128 gtk_signal_connect(GTK_OBJECT(rem_button), "clicked",
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1129 GTK_SIGNAL_FUNC(remove_chat), cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1130 gtk_signal_connect(GTK_OBJECT(add_button), "clicked",
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1131 GTK_SIGNAL_FUNC(add_chat), cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1132
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1133
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1134
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1135 label = gtk_label_new(_("List of available chats"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1136 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1137
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1138 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1139 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1140 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
1141 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1142 gtk_table_attach(GTK_TABLE(table), sw1, 0, 1, 2, 3,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1143 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1144 5, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1145 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
1146 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1147
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1148
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1149 label = gtk_label_new(_("List of subscribed chats"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1150 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1151
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1152 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1153 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1154 gtk_table_attach(GTK_TABLE(table), sw2, 1, 2, 2, 3,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1155 GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1156 5, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1157 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
1158 GTK_SHRINK, GTK_SHRINK, 0, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1159
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 item = gtk_list_item_new_with_label(_("Gaim Chat"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1162 cr = g_new0(struct chat_room, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1163 strcpy(cr->name, _("Gaim Chat"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1164 cr->exchange = 4;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1165 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1166 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1167 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
1168
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 while(crs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1171 cr = (struct chat_room *)crs->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1172 item = gtk_list_item_new_with_label(cr->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1173 gtk_object_set_user_data(GTK_OBJECT(item), cr);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1174 gtk_widget_show(item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1175 items = g_list_append(items, item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1176
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1177 crs = crs->next;
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
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1180 gtk_list_append_items(GTK_LIST(list2), items);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1181
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1182 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1183 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1184
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1185 static GtkWidget *show_color_pref(GtkWidget *box, gboolean fgc)
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1186 {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1187 /* more stuff stolen from X-Chat */
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1188 GtkWidget *swid;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1189 GdkColor c;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1190 GtkStyle *style;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1191 c.pixel = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1192 if (fgc) {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1193 if (font_options & OPT_FONT_FGCOL) {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1194 c.red = fgcolor.red << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1195 c.blue = fgcolor.blue << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1196 c.green = fgcolor.green << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1197 } else {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1198 c.red = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1199 c.blue = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1200 c.green = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1201 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1202 } else {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1203 if (font_options & OPT_FONT_BGCOL) {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1204 c.red = bgcolor.red << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1205 c.blue = bgcolor.blue << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1206 c.green = bgcolor.green << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1207 } else {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1208 c.red = 0xffff;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1209 c.blue = 0xffff;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1210 c.green = 0xffff;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1211 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1212 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1213
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1214 style = gtk_style_new();
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1215 style->bg[0] = c;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1216
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1217 swid = gtk_event_box_new();
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1218 gtk_widget_set_style(GTK_WIDGET(swid), style);
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1219 gtk_style_unref(style);
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1220 gtk_widget_set_usize(GTK_WIDGET(swid), 40, -1);
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1221 gtk_box_pack_start(GTK_BOX(box), swid, FALSE, FALSE, 5);
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1222 gtk_widget_show(swid);
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1223 return swid;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1224 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1225
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1226 GtkWidget *pref_fg_picture = NULL;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1227 GtkWidget *pref_bg_picture = NULL;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1228
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1229 static fgbgdes(GtkWidget *w, gpointer d)
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1230 {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1231 pref_fg_picture = NULL;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1232 pref_bg_picture = NULL;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1233 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1234
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1235 void update_color(GtkWidget *w, GtkWidget *pic)
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1236 {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1237 GdkColor c;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1238 GtkStyle *style;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1239 c.pixel = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1240 if (pic == pref_fg_picture) {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1241 if (font_options & OPT_FONT_FGCOL) {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1242 c.red = fgcolor.red << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1243 c.blue = fgcolor.blue << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1244 c.green = fgcolor.green << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1245 } else {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1246 c.red = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1247 c.blue = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1248 c.green = 0;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1249 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1250 } else {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1251 if (font_options & OPT_FONT_BGCOL) {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1252 c.red = bgcolor.red << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1253 c.blue = bgcolor.blue << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1254 c.green = bgcolor.green << 8;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1255 } else {
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1256 c.red = 0xffff;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1257 c.blue = 0xffff;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1258 c.green = 0xffff;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1259 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1260 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1261
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1262 style = gtk_style_new();
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1263 style->bg[0] = c;
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1264 gtk_widget_set_style(pic, style);
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1265 gtk_style_unref(style);
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1266 }
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1267
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1268 static void font_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1269 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1270 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1271 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1272 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1273 GtkWidget *sep;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1274 GtkWidget *hbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1275 GtkWidget *button;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1276 GtkWidget *select;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1277
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1278 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1279 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1280
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1281 prefdialog = gtk_frame_new(_("Font Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1282 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1283
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1284 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1285 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1286 gtk_widget_show(box);
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 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
1289 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1290 gtk_widget_show(label);
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 gaim_button(_("Bold Text"), &font_options, OPT_FONT_BOLD, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1293 gaim_button(_("Italics Text"), &font_options, OPT_FONT_ITALIC, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1294 gaim_button(_("Underlined Text"), &font_options, OPT_FONT_UNDERLINE, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1295 gaim_button(_("Strike Text"), &font_options, OPT_FONT_STRIKE, box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1296
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1297 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1298 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1299 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1300
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1301 hbox = gtk_hbox_new(FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1302 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1303 gtk_widget_show(hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1304
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1305 pref_fg_picture = show_color_pref(hbox, TRUE);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1306 button = gaim_button(_("Text Color"), &font_options, OPT_FONT_FGCOL, hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1307
855
82673bb41e2f [gaim-migrate @ 865]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1308 select = picture_button(prefs, _("Select"), fgcolor_xpm);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1309 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1310 if (!(font_options & OPT_FONT_FGCOL))
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1311 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 855
diff changeset
1312 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_fgcolor_dialog), NULL);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1313 gtk_widget_show(select);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1314
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1315 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1316 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), pref_fg_picture);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1317
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1318 hbox = gtk_hbox_new(FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1319 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1320 gtk_widget_show(hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1321
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1322 pref_bg_picture = show_color_pref(hbox, FALSE);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1323 button = gaim_button(_("Background Color"), &font_options, OPT_FONT_BGCOL, hbox);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1324
855
82673bb41e2f [gaim-migrate @ 865]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 834
diff changeset
1325 select = picture_button(prefs, _("Select"), bgcolor_xpm);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1326 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 5);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1327 if (!(font_options & OPT_FONT_BGCOL))
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1328 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
858
3de6e98e8898 [gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 855
diff changeset
1329 gtk_signal_connect(GTK_OBJECT(select), "clicked", GTK_SIGNAL_FUNC(show_bgcolor_dialog), NULL);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1330 gtk_widget_show(select);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1331
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 660
diff changeset
1332 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select);
873
789df4b47508 [gaim-migrate @ 883]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 864
diff changeset
1333 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(update_color), pref_bg_picture);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1334
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1335 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1336 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1337 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1338
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1339 hbox = gtk_hbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1340 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1341 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1342
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1343 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
1344
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1345 select = picture_button(prefs, _("Select"), fontface2_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1346 gtk_box_pack_start(GTK_BOX(hbox), select, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1347 if (!(font_options & OPT_FONT_FACE))
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1348 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1349 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
1350 gtk_widget_show(select);
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 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
1353
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1354 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1355 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1356
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1357 static void sound_page()
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 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1360 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1361 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1362
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1363 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1364 gtk_widget_destroy(prefdialog);
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 prefdialog = gtk_frame_new(_("Sound Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1367 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1368
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1369 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1370 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1371 gtk_widget_show(box);
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 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
1374 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1375 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1376
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1377 #ifdef USE_GNOME
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1378 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
1379 #endif
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1380 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
1381 gaim_button(_("Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, box);
775
9614e69f68ca [gaim-migrate @ 785]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 768
diff changeset
1382 gaim_button(_("Beep instead of playing sound"), &sound_options, OPT_SOUND_BEEP, box);
652
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 gtk_widget_show(prefdialog);
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
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1387 static void event_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1388 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1389 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1390 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1391 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1392 GtkWidget *sep;
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 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1395 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1396
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1397 prefdialog = gtk_frame_new(_("Sound Events"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1398 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1399
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1400 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1401 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1402 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1403
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1404 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
1405 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1406 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1407
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1408 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
1409 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
1410
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1411 sep = gtk_hseparator_new();
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1412 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1413 gtk_widget_show(sep);
b54b8d64d8b8 [gaim-migrate @ 733]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 717
diff changeset
1414
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1415 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
1416 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
1417 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
1418
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1419 sep = gtk_hseparator_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1420 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1421 gtk_widget_show(sep);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1422
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1423 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
1424 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
1425
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1426 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1427 }
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 static struct away_message *cur_message;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1430 static char *edited_message;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1431 static GtkWidget *away_text;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1432
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1433 void away_list_clicked(GtkWidget *widget, struct away_message *a)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1434 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1435 gchar buffer[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1436 guint text_len;
821
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1437
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1438 cur_message = a;
821
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1439
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1440 /* Get proper Length */
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1441 text_len = gtk_text_get_length(GTK_TEXT(away_text));
821
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1442
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1443 /* Clear the Box */
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1444 gtk_text_set_point(GTK_TEXT(away_text), 0 );
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1445 gtk_text_forward_delete (GTK_TEXT(away_text), text_len);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1446
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1447 /* Fill the text box with new message */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1448 strcpy(buffer, a->message);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1449 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
1450 }
821
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1451
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1452 void save_away_message(GtkWidget *widget, void *dummy)
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1453 {
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1454 /* grab the current message */
763
4aeb969c70c9 [gaim-migrate @ 773]
Todd Kulesza <fflewddur>
parents: 755
diff changeset
1455 edited_message = gtk_editable_get_chars(GTK_EDITABLE(away_text), 0, -1);
821
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1456 strcpy(cur_message->message, edited_message);
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1457 save_prefs();
652
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 void remove_away_message(GtkWidget *widget, void *dummy)
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 GList *i;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1463 struct away_message *a;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1464
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1465 i = GTK_LIST(prefs_away_list)->selection;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1466
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1467 if (!i->next) {
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1468 int text_len = gtk_text_get_length(GTK_TEXT(away_text));
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1469 gtk_text_set_point(GTK_TEXT(away_text), 0 );
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1470 gtk_text_forward_delete (GTK_TEXT(away_text), text_len);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1471 }
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1472 a = gtk_object_get_user_data(GTK_OBJECT(i->data));
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1473 rem_away_mess(NULL, a);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1474 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1475
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1476 static void paldest(GtkWidget *m, gpointer n)
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1477 {
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1478 gtk_widget_destroy(prefs_away_list);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1479 prefs_away_list = NULL;
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1480 }
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
1481
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1482 static void do_away_mess(GtkWidget *m, gpointer n)
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1483 {
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1484 GList *i = GTK_LIST(prefs_away_list)->selection;
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1485 if (i)
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1486 do_away_message(NULL, gtk_object_get_user_data(GTK_OBJECT(i->data)));
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1487 }
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1488
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1489 static void away_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1490 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1491 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1492 GtkWidget *box;
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1493 GtkWidget *hbox;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1494 GtkWidget *top;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1495 GtkWidget *bot;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1496 GtkWidget *sw;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1497 GtkWidget *sw2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1498 GtkWidget *button;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1499 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1500 GtkWidget *list_item;
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1501 GtkWidget *sep;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1502 GList *awy = away_messages;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1503 struct away_message *a;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1504 char buffer[BUF_LONG];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1505
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1506 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1507 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1508
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1509 prefdialog = gtk_frame_new(_("Away Messages"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1510 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
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 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1513 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1514 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1515
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1516 hbox = gtk_hbox_new(TRUE, 0);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1517 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1518 gtk_widget_set_usize(hbox, -1, 30);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1519 gtk_widget_show(hbox);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1520
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1521 hbox = gtk_hbox_new(TRUE, 0);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1522 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1523 gtk_widget_show(hbox);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1524
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1525 label = gtk_label_new(_("Title"));
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1526 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1527 gtk_widget_show(label);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1528
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1529 label = gtk_label_new(_("Message"));
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1530 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1531 gtk_widget_show(label);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1532
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1533 top = gtk_hbox_new(FALSE, 0);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1534 gtk_box_pack_start(GTK_BOX(box), top, FALSE, TRUE, 0);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1535 gtk_widget_show(top);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1536
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1537 sw = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1538 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1539 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1540 gtk_box_pack_start(GTK_BOX(top), sw, TRUE, TRUE, 0);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1541 gtk_widget_set_usize(sw, -1, 225);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1542 gtk_widget_show(sw);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1543
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1544 prefs_away_list = gtk_list_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1545 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
1546 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
1547 gtk_widget_show(prefs_away_list);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1548
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1549 sw2 = gtk_scrolled_window_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1550 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1551 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1552 gtk_box_pack_start(GTK_BOX(top), sw2, TRUE, TRUE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1553 gtk_widget_show(sw2);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1554
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1555 away_text = gtk_text_new(NULL, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1556 gtk_container_add(GTK_CONTAINER(sw2), away_text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1557 gtk_text_set_word_wrap(GTK_TEXT(away_text), TRUE);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1558 gtk_text_set_editable(GTK_TEXT(away_text), FALSE);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1559 gtk_widget_show(away_text);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1560
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1561 bot = gtk_hbox_new(FALSE, 0);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1562 gtk_box_pack_start(GTK_BOX(box), bot, FALSE, FALSE, 5);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1563 gtk_widget_show(bot);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1564
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1565 button = picture_button(prefs, _("Add"), gnome_add_xpm);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1566 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1567 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1568
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1569 button = picture_button(prefs, _("Edit"), save_xpm);
717
d7c39f12eb89 [gaim-migrate @ 727]
Todd Kulesza <fflewddur>
parents: 710
diff changeset
1570 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
1571 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5);
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1572
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1573 button = picture_button(prefs, _("Make Away"), gnome_preferences_xpm);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1574 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(do_away_mess), NULL);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1575 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1576
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1577 button = picture_button(prefs, _("Remove"), gnome_remove_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1578 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
1579 gtk_box_pack_start(GTK_BOX(bot), button, TRUE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1580
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1581 if (awy != NULL) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1582 a = (struct away_message *)awy->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1583 g_snprintf(buffer, sizeof(buffer), "%s", a->message);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1584 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
1585 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1586
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1587 while (awy) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1588 a = (struct away_message *)awy->data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1589 label = gtk_label_new(a->name);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1590 list_item = gtk_list_item_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1591 gtk_container_add(GTK_CONTAINER(list_item), label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1592 gtk_signal_connect(GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(away_list_clicked), a);
821
02250312c02d [gaim-migrate @ 831]
Todd Kulesza <fflewddur>
parents: 775
diff changeset
1593 /* gtk_signal_connect(GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(away_list_unclicked), a);*/
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1594 gtk_object_set_user_data(GTK_OBJECT(list_item), a);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1595
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1596 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1597 gtk_container_add(GTK_CONTAINER(prefs_away_list), list_item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1598 gtk_widget_show(list_item);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1599
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1600 awy = awy->next;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1601 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1602
832
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1603 sep = gtk_hseparator_new();
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1604 gtk_box_pack_start(GTK_BOX(box), sep, FALSE, FALSE, 0);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1605 gtk_widget_show(sep);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1606
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1607 hbox = gtk_hbox_new(TRUE, 0);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1608 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1609 gtk_widget_show(hbox);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1610
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1611 gaim_button(_("Ignore new conversations when away"), &general_options, OPT_GEN_DISCARD_WHEN_AWAY, hbox);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1612 gaim_button(_("Sounds while away"), &sound_options, OPT_SOUND_WHEN_AWAY, hbox);
0142b4c66394 [gaim-migrate @ 842]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 830
diff changeset
1613
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1614 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1615 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1616
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1617 static GtkWidget *browser_entry = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1618 static GtkWidget *new_window = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1619
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1620 static void set_browser(GtkWidget *w, int *data)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1621 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1622 web_browser = (int)data;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1623 if (web_browser != BROWSER_MANUAL) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1624 if (browser_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1625 gtk_widget_set_sensitive(browser_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1626 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1627 if (browser_entry)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1628 gtk_widget_set_sensitive(browser_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1629 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1630
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1631 if (web_browser != BROWSER_NETSCAPE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1632 if (new_window)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1633 gtk_widget_set_sensitive(new_window, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1634 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1635 if (new_window)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1636 gtk_widget_set_sensitive(new_window, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1637 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1638
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1639
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1640 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1641 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1642
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1643 static int manualentry_key_pressed(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1644 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1645 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
1646 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1647 return TRUE;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1648 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1649
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1650 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
1651 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1652 GtkWidget *opt;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1653
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1654 if (!set)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1655 opt = gtk_radio_button_new_with_label(NULL, label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1656 else
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1657 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
1658 gtk_box_pack_start(GTK_BOX(box), opt, FALSE, FALSE, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1659 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
1660 gtk_widget_show(opt);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1661 if (web_browser == which)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1662 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1663
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1664 return opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1665 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1666
748
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1667 static void brentdes(GtkWidget *m, gpointer n)
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1668 {
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1669 browser_entry = NULL;
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1670 new_window = NULL;
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1671 }
c32d4fae9bbd [gaim-migrate @ 758]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 747
diff changeset
1672
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1673 static void browser_page()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1674 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1675 GtkWidget *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1676 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1677 GtkWidget *label;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1678 GtkWidget *opt;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1679
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1680 parent = prefdialog->parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1681 gtk_widget_destroy(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1682 prefs_away_list = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1683
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1684 prefdialog = gtk_frame_new(_("Browser Options"));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1685 gtk_container_add(GTK_CONTAINER(parent), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1686
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1687 box = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1688 gtk_container_add(GTK_CONTAINER(prefdialog), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1689 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1690
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1691 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
1692 gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1693 gtk_widget_show(label);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1694
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1695 opt = browser_radio(_("Netscape"), BROWSER_NETSCAPE, box, NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1696 opt = browser_radio(_("KFM"), BROWSER_KFM, box, opt);
734
a42e259c423f [gaim-migrate @ 744]
Rob Flynn <gaim@robflynn.com>
parents: 733
diff changeset
1697 #ifdef USE_GNOME
a42e259c423f [gaim-migrate @ 744]
Rob Flynn <gaim@robflynn.com>
parents: 733
diff changeset
1698 opt = browser_radio(_("GNOME URL Handler"), BROWSER_GNOME, box, opt);
a42e259c423f [gaim-migrate @ 744]
Rob Flynn <gaim@robflynn.com>
parents: 733
diff changeset
1699 #endif /* USE_GNOME */
735
51f1b6f7794b [gaim-migrate @ 745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 734
diff changeset
1700 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
1701 opt = browser_radio(_("Manual"), BROWSER_MANUAL, box, opt);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1702
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1703 browser_entry = gtk_entry_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1704 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
1705 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1706 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
1707 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
1708 gtk_widget_show(browser_entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1709
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1710 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
1711
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1712 if (web_browser != BROWSER_MANUAL) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1713 gtk_widget_set_sensitive(browser_entry, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1714 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1715 gtk_widget_set_sensitive(browser_entry, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1716 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1717
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1718 if (web_browser != BROWSER_NETSCAPE) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1719 gtk_widget_set_sensitive(new_window, FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1720 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1721 gtk_widget_set_sensitive(new_window, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1722 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1723
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1724 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1725 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1726
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1727 static void try_me(GtkCTree *ctree, GtkCTreeNode *node)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1728 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1729 /* this is a hack */
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1730 void (*func)();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1731 func = gtk_ctree_node_get_row_data(ctree, node);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1732 (*func)();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1733 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1734
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1735 void show_prefs()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1736 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1737 GtkWidget *vbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1738 GtkWidget *hpaned;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1739 GtkWidget *scroll;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1740 GtkWidget *preftree;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1741 GtkWidget *container;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1742 GtkWidget *hbox;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1743 GtkWidget *close;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1744
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1745 if (prefs) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1746 gtk_widget_show(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1747 return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1748 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1749
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1750 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL);
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 902
diff changeset
1751 gtk_window_set_wmclass(GTK_WINDOW(prefs), "preferences", "Gaim");
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1752 gtk_widget_realize(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1753 aol_icon(prefs->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1754 gtk_container_border_width(GTK_CONTAINER(prefs), 10);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1755 gtk_window_set_title(GTK_WINDOW(prefs), _("Gaim - Preferences"));
768
0b160e27904b [gaim-migrate @ 778]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 763
diff changeset
1756 gtk_widget_set_usize(prefs, 600, 550);
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1757 gtk_signal_connect(GTK_OBJECT(prefs), "destroy",
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1758 GTK_SIGNAL_FUNC(delete_prefs), NULL);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1759
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1760 vbox = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1761 gtk_container_add(GTK_CONTAINER(prefs), vbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1762 gtk_widget_show(vbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1763
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1764 hpaned = gtk_hpaned_new();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1765 gtk_box_pack_start(GTK_BOX(vbox), hpaned, TRUE, TRUE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1766 gtk_widget_show(hpaned);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1767
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1768 scroll = gtk_scrolled_window_new(NULL, NULL);
768
0b160e27904b [gaim-migrate @ 778]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 763
diff changeset
1769 gtk_paned_pack1(GTK_PANED(hpaned), scroll, FALSE, FALSE);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1770 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1771 GTK_POLICY_NEVER, GTK_POLICY_NEVER);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1772 gtk_widget_set_usize(scroll, 125, -1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1773 gtk_widget_show(scroll);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1774
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1775 preftree = gtk_ctree_new(1, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1776 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
1777 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
1778 gtk_clist_set_reorderable(GTK_CLIST(preftree), FALSE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1779 gtk_container_add(GTK_CONTAINER(scroll), preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1780 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
1781 gtk_widget_show(preftree);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1782
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1783 container = gtk_frame_new(NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1784 gtk_container_set_border_width(GTK_CONTAINER(container), 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1785 gtk_frame_set_shadow_type(GTK_FRAME(container), GTK_SHADOW_NONE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1786 gtk_paned_pack2(GTK_PANED(hpaned), container, TRUE, TRUE);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1787 gtk_widget_show(container);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1788
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1789 prefdialog = gtk_vbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1790 gtk_container_add(GTK_CONTAINER(container), prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1791 gtk_widget_show(prefdialog);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1792
901
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1793 prefs_build_general(preftree);
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1794 prefs_build_connect(preftree);
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
1795 #ifdef USE_APPLET
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
1796 prefs_build_applet(preftree);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
1797 #endif
901
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1798 prefs_build_buddy(preftree);
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1799 prefs_build_convo(preftree);
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1800 prefs_build_sound(preftree);
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1801 prefs_build_away(preftree);
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1802 prefs_build_browser(preftree);
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1803
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
1804 //general_page();
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1805
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1806 hbox = gtk_hbox_new(FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1807 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1808 gtk_widget_show(hbox);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1809
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1810 close = picture_button(prefs, _("Close"), cancel_xpm);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1811 gtk_box_pack_end(GTK_BOX(hbox), close, FALSE, FALSE, 5);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1812 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
1813
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1814 gtk_widget_show(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1815 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1816
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1817 char debug_buff[BUF_LONG];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1818
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1819 static gint debug_delete(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1820 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1821 if (debugbutton)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1822 gtk_button_clicked(GTK_BUTTON(debugbutton));
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1823 if (general_options & OPT_GEN_DEBUG)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1824 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1825 general_options = general_options ^ (int)OPT_GEN_DEBUG;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1826 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1827 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1828 g_free(dw);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1829 dw=NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1830 return FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1831
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1832 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1833
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1834 static void build_debug()
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1835 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1836 GtkWidget *scroll;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1837 GtkWidget *box;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1838 if (!dw)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1839 dw = g_new0(struct debug_window, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1840
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1841 box = gtk_hbox_new(FALSE,0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1842 dw->window = gtk_window_new(GTK_WINDOW_DIALOG);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1843 gtk_window_set_title(GTK_WINDOW(dw->window), _("GAIM debug output window"));
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 902
diff changeset
1844 gtk_window_set_wmclass(GTK_WINDOW(dw->window),
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 902
diff changeset
1845 "debug_out", "Gaim");
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1846 gtk_container_add(GTK_CONTAINER(dw->window), box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1847 dw->entry = gtk_text_new(NULL,NULL);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1848 gtk_widget_set_usize(dw->entry, 500, 200);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1849 scroll = gtk_vscrollbar_new(GTK_TEXT(dw->entry)->vadj);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1850 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
1851 gtk_box_pack_end(GTK_BOX(box), scroll,FALSE,FALSE,0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1852 gtk_widget_show(dw->entry);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1853 gtk_widget_show(scroll);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1854 gtk_widget_show(box);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1855 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
1856 gtk_widget_show(dw->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1857 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1858
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1859 void show_debug(GtkObject *obj)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1860 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1861 if((general_options & OPT_GEN_DEBUG)) {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1862 if(!dw || !dw->window)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1863 build_debug();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1864 gtk_widget_show(dw->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1865 } else {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1866 if (!dw) return;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1867 gtk_widget_destroy(dw->window);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1868 dw->window = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1869 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1870 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1871
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1872 void debug_print(char *chars)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1873 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1874 if (general_options & OPT_GEN_DEBUG && dw)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1875 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
1876 #ifdef DEBUG
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1877 printf("%s\n", chars);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1878 #endif
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1879 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1880
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1881 static gint handle_delete(GtkWidget *w, GdkEvent *event, void *dummy)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1882 {
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1883 save_prefs();
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1884
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1885 if (cp)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1886 g_free(cp);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1887 cp = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1888
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1889 if (event == NULL)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1890 gtk_widget_destroy(prefs);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1891 prefs = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1892 prefdialog = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1893 debugbutton = NULL;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1894
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1895 return FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1896 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1897
915
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1898 static void delete_prefs(GtkWidget *w, void *data)
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1899 {
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1900 if (prefs) {
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1901 save_prefs();
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1902 gtk_widget_destroy(prefs);
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1903 }
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1904 prefs = NULL;
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1905 }
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1906
378c862a2381 [gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 910
diff changeset
1907
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1908 void set_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1909 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1910 *option = !(*option);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1911 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1912
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1913 void set_general_option(GtkWidget *w, int *option)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1914 {
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1915 general_options = general_options ^ (int)option;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1916
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1917 if ((int)option == OPT_GEN_LOG_ALL)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1918 update_log_convs();
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1919
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
1920 if ((int)option == OPT_GEN_KEEPALIVE)
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
1921 update_keepalive(general_options & OPT_GEN_KEEPALIVE);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
1922
705
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1923 if (prefrem)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1924 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
1925 if (remember)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1926 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
1927 if (prefrem)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1928 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(prefrem),
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1929 (general_options & OPT_GEN_REMEMBER_PASS));
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1930 if (remember)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1931 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(remember),
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1932 (general_options & OPT_GEN_REMEMBER_PASS));
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1933 if (prefrem)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1934 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
1935 if (remember)
dcf672c5a1ff [gaim-migrate @ 715]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 702
diff changeset
1936 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
1937
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1938 save_prefs();
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1939 }
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1940
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1941 void set_display_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1942 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1943 display_options = display_options ^ (int)option;
9
effb8a20de26 [gaim-migrate @ 18]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
1944
701
8a9e9e694ba4 [gaim-migrate @ 711]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 696
diff changeset
1945 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
1946
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 10
diff changeset
1947 if (blist) update_button_pix();
9
effb8a20de26 [gaim-migrate @ 18]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
1948
84
51943f1a97a0 [gaim-migrate @ 94]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 82
diff changeset
1949 #ifdef USE_APPLET
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 18
diff changeset
1950 update_pixmaps();
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 18
diff changeset
1951 #endif
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1952
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1953 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1954 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1955
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1956 void set_sound_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1957 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1958 sound_options = sound_options ^ (int)option;
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1959 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1960 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1961
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1962 void set_font_option(GtkWidget *w, int *option)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1963 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1964 font_options = font_options ^ (int)option;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1965
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1966 update_font_buttons();
572
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1967
faca21605e1b [gaim-migrate @ 582]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
1968 save_prefs();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1969 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1970
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1971 GtkWidget *gaim_button(const char *text, int *options, int option, GtkWidget *page)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1972 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1973 GtkWidget *button;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1974 button = gtk_check_button_new_with_label(text);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1975 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), (*options & option));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1976 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1977
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1978 if (options == &font_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1979 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
1980
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1981 if (options == &sound_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1982 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
1983 if (options == &display_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1984 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
1985
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1986 if (options == &general_options)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1987 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
1988 gtk_widget_show(button);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1989
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1990 return button;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1991 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1992
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1993 void prefs_build_general(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1994 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1995 GtkCTreeNode *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1996 char *text[1];
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 337
diff changeset
1997
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1998 text[0] = _("General");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
1999 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2000 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2001 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, general_page);
901
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
2002
f168f2c7b357 [gaim-migrate @ 911]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 893
diff changeset
2003 gtk_ctree_select(GTK_CTREE(preftree), parent);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2004 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2005
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2006 void prefs_build_connect(GtkWidget *preftree)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2007 {
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2008 GtkCTreeNode *parent, *node;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2009 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2010
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2011 text[0] = _("Connection");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2012 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2013 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2014 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, connect_page);
891
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2015
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2016 text[0] = _("TOC Options");
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2017 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2018 text, 5, NULL, NULL, NULL, NULL, 0, 1);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2019 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, toc_page);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2020
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2021 text[0] = _("Oscar Options");
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2022 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2023 text, 5, NULL, NULL, NULL, NULL, 0, 1);
fa2feef25e1e [gaim-migrate @ 901]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 878
diff changeset
2024 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), node, oscar_page);
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2025 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2026
930
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2027 #ifdef USE_APPLET
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2028 void prefs_build_applet(GtkWidget *preftree)
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2029 {
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2030 GtkCTreeNode *parent, *node;
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2031 char *text[1];
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2032
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2033 text[0] = _("Applet");
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2034 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2035 text, 5, NULL, NULL, NULL, NULL, 0, 1);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2036 gtk_ctree_node_set_row_data(GTK_CTREE(preftree), parent, applet_page);
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2037 }
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2038 #endif
a88af4cc626a [gaim-migrate @ 940]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 915
diff changeset
2039
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2040 void prefs_build_buddy(GtkWidget *preftree)
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2041 {
678
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
2042 GtkCTreeNode *parent, *node;
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2043 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2044
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2045 text[0] = _("Buddy List");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2046 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2047 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2048 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
2049
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
2050 /* 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
2051 text[0] = _("Permit/Deny");
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
2052 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
2053 text, 5, NULL, NULL, NULL, NULL, 0, 1);
c72f58814e9f [gaim-migrate @ 688]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
2054 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
2055 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2056
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2057 void prefs_build_convo(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2058 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2059 GtkCTreeNode *parent, *node, *node2;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2060 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2061
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2062 text[0] = _("Conversations");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2063 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2064 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2065 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
2066
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2067 text[0] = _("IM Window");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2068 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2069 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2070 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
2071
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2072 text[0] = _("Chat Window");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2073 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2074 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2075 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
2076
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2077 text[0] = _("Chat Rooms");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2078 node2 = gtk_ctree_insert_node(GTK_CTREE(preftree), node, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2079 text, 5, NULL, NULL, NULL, NULL, 1, 0);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2080 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
2081
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2082 text[0] = _("Font Options");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2083 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2084 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2085 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
2086 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2087
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2088 void prefs_build_sound(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2089 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2090 GtkCTreeNode *parent, *node;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2091 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2092
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2093 text[0] = _("Sounds");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2094 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2095 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2096 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
2097
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2098 text[0] = _("Events");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2099 node = gtk_ctree_insert_node(GTK_CTREE(preftree), parent, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2100 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2101 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
2102 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2103
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2104 void prefs_build_away(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2105 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2106 GtkCTreeNode *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2107 char *text[1];
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2108
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2109 text[0] = _("Away Messages");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2110 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2111 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2112 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
2113 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2114
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2115 void prefs_build_browser(GtkWidget *preftree)
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2116 {
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2117 GtkCTreeNode *parent;
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2118 char *text[1];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2119
652
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2120 text[0] = _("Browser");
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2121 parent = gtk_ctree_insert_node(GTK_CTREE(preftree), NULL, NULL,
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2122 text, 5, NULL, NULL, NULL, NULL, 0, 1);
4d3285caa191 [gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 619
diff changeset
2123 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
2124 }