annotate gtk/gtkprefs.c @ 14853:910e783fbbc7

[gaim-migrate @ 17622] If you have the debug window open, and you activate some menuitem in the conversation window without focusing on 'Conversation', Gaim freezes. This is a fix for that (re: "Hang w/ Debug Window" in gaim-devel). committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 30 Oct 2006 00:40:19 +0000
parents 634014c941ec
children 71149a751439
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1 /**
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2 * @file gtkprefs.c GTK+ Preferences
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
3 * @ingroup gtkui
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
4 *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
5 * gaim
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
6 *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
9 * source distribution.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
10 *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
15 *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
20 *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
24 *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
25 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
26 #include "internal.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
27 #include "gtkgaim.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
28
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
29 #include "debug.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
30 #include "notify.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
31 #include "prefs.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
32 #include "proxy.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
33 #include "prpl.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
34 #include "request.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
35 #include "savedstatuses.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
36 #include "sound.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
37 #include "util.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
38 #include "network.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
39
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
40 #include "gtkblist.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
41 #include "gtkconv.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
42 #include "gtkdebug.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
43 #include "gtkdialogs.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
44 #include "gtkimhtml.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
45 #include "gtkimhtmltoolbar.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
46 #include "gtkprefs.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
47 #include "gtksavedstatuses.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
48 #include "gtksound.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
49 #include "gtkthemes.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
50 #include "gtkutils.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
51 #include "gaimstock.h"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
52
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
53 #define PROXYHOST 0
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
54 #define PROXYPORT 1
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
55 #define PROXYUSER 2
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
56 #define PROXYPASS 3
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
57
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
58 static int sound_row_sel = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
59 static GtkWidget *prefsnotebook;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
60
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
61 static GtkWidget *sound_entry = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
62 static GtkListStore *smiley_theme_store = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
63 static GtkWidget *prefs_proxy_frame = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
64
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
65 static GtkWidget *prefs = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
66 static GtkWidget *debugbutton = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
67 static int notebook_page = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
68 static GtkTreeRowReference *previous_smiley_row = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
69
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
70 /*
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
71 * PROTOTYPES
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
72 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
73 static int prefs_notebook_add_page(const char*, GdkPixbuf*,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
74 GtkWidget*, GtkTreeIter*,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
75 GtkTreeIter*, int);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
76 static void delete_prefs(GtkWidget *, void *);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
77
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
78 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
79 update_spin_value(GtkWidget *w, GtkWidget *spin)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
80 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
81 const char *key = g_object_get_data(G_OBJECT(spin), "val");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
82 int value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
83
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
84 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
85
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
86 gaim_prefs_set_int(key, value);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
87 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
88
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
89 GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
90 gaim_gtk_prefs_labeled_spin_button(GtkWidget *box, const gchar *title,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
91 const char *key, int min, int max, GtkSizeGroup *sg)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
92 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
93 GtkWidget *hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
94 GtkWidget *label;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
95 GtkWidget *spin;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
96 GtkObject *adjust;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
97 int val;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
98
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
99 val = gaim_prefs_get_int(key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
100
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
101 hbox = gtk_hbox_new(FALSE, 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
102 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
103 gtk_widget_show(hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
104
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
105 label = gtk_label_new_with_mnemonic(title);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
106 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
107 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
108 gtk_widget_show(label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
109
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
110 adjust = gtk_adjustment_new(val, min, max, 1, 1, 1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
111 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
112 g_object_set_data(G_OBJECT(spin), "val", (char *)key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
113 if (max < 10000)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
114 gtk_widget_set_size_request(spin, 50, -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
115 else
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
116 gtk_widget_set_size_request(spin, 60, -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
117 gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
118 g_signal_connect(G_OBJECT(adjust), "value-changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
119 G_CALLBACK(update_spin_value), GTK_WIDGET(spin));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
120 gtk_widget_show(spin);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
121
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
122 gtk_label_set_mnemonic_widget(GTK_LABEL(label), spin);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
123
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
124 if (sg) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
125 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
126 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
127 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
128
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
129 gaim_set_accessible_label (spin, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
130
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
131 return hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
132 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
133
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
134 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
135 entry_set(GtkEntry *entry, gpointer data) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
136 const char *key = (const char*)data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
137
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
138 gaim_prefs_set_string(key, gtk_entry_get_text(entry));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
139 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
140
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
141 GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
142 gaim_gtk_prefs_labeled_entry(GtkWidget *page, const gchar *title,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
143 const char *key, GtkSizeGroup *sg)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
144 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
145 GtkWidget *hbox, *label, *entry;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
146 const gchar *value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
147
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
148 value = gaim_prefs_get_string(key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
149
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
150 hbox = gtk_hbox_new(FALSE, 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
151 gtk_box_pack_start(GTK_BOX(page), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
152 gtk_widget_show(hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
153
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
154 label = gtk_label_new_with_mnemonic(title);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
155 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
156 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
157 gtk_widget_show(label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
158
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
159 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
160 gtk_entry_set_text(GTK_ENTRY(entry), value);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
161 gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
162 g_signal_connect(G_OBJECT(entry), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
163 G_CALLBACK(entry_set), (char*)key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
164 gtk_widget_show(entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
165
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
166 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
167
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
168 if(sg) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
169 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
170 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
171 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
172
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
173 gaim_set_accessible_label(entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
174
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
175 return hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
176 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
177
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
178 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
179 dropdown_set(GObject *w, const char *key)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
180 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
181 const char *str_value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
182 int int_value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
183 GaimPrefType type;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
184
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
185 type = GPOINTER_TO_INT(g_object_get_data(w, "type"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
186
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
187 if (type == GAIM_PREF_INT) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
188 int_value = GPOINTER_TO_INT(g_object_get_data(w, "value"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
189
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
190 gaim_prefs_set_int(key, int_value);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
191 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
192 else if (type == GAIM_PREF_STRING) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
193 str_value = (const char *)g_object_get_data(w, "value");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
194
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
195 gaim_prefs_set_string(key, str_value);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
196 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
197 else if (type == GAIM_PREF_BOOLEAN) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
198 gaim_prefs_set_bool(key,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
199 GPOINTER_TO_INT(g_object_get_data(w, "value")));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
200 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
201 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
202
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
203 GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
204 gaim_gtk_prefs_dropdown_from_list(GtkWidget *box, const gchar *title,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
205 GaimPrefType type, const char *key, GList *menuitems)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
206 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
207 GtkWidget *dropdown, *opt, *menu;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
208 GtkWidget *label = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
209 GtkWidget *hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
210 gchar *text;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
211 const char *stored_str = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
212 int stored_int = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
213 int int_value = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
214 const char *str_value = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
215 int o = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
216
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
217 g_return_val_if_fail(menuitems != NULL, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
218
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
219 if (title != NULL) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
220 hbox = gtk_hbox_new(FALSE, 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
221 /*gtk_container_add (GTK_CONTAINER (box), hbox);*/
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
222 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
223 gtk_widget_show(hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
224
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
225 label = gtk_label_new_with_mnemonic(title);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
226 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
227 gtk_widget_show(label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
228 } else {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
229 hbox = box;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
230 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
231
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
232 #if 0 /* GTK_CHECK_VERSION(2,4,0) */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
233 if(type == GAIM_PREF_INT)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
234 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
235 else if(type == GAIM_PREF_STRING)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
236 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
237 dropdown = gtk_combo_box_new_with_model(model);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
238 #else
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
239 dropdown = gtk_option_menu_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
240 menu = gtk_menu_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
241 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
242
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
243 if (label != NULL) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
244 gtk_label_set_mnemonic_widget(GTK_LABEL(label), dropdown);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
245 gaim_set_accessible_label (dropdown, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
246 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
247
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
248 if (type == GAIM_PREF_INT)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
249 stored_int = gaim_prefs_get_int(key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
250 else if (type == GAIM_PREF_STRING)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
251 stored_str = gaim_prefs_get_string(key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
252
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
253 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
254 menuitems = g_list_next(menuitems);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
255 g_return_val_if_fail(menuitems != NULL, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
256
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
257 opt = gtk_menu_item_new_with_label(text);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
258
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
259 g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
260
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
261 if (type == GAIM_PREF_INT) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
262 int_value = GPOINTER_TO_INT(menuitems->data);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
263 g_object_set_data(G_OBJECT(opt), "value",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
264 GINT_TO_POINTER(int_value));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
265 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
266 else if (type == GAIM_PREF_STRING) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
267 str_value = (const char *)menuitems->data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
268
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
269 g_object_set_data(G_OBJECT(opt), "value", (char *)str_value);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
270 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
271 else if (type == GAIM_PREF_BOOLEAN) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
272 g_object_set_data(G_OBJECT(opt), "value",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
273 menuitems->data);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
274 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
275
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
276 g_signal_connect(G_OBJECT(opt), "activate",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
277 G_CALLBACK(dropdown_set), (char *)key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
278
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
279 gtk_widget_show(opt);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
280 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
281
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
282 if ((type == GAIM_PREF_INT && stored_int == int_value) ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
283 (type == GAIM_PREF_STRING && stored_str != NULL &&
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
284 !strcmp(stored_str, str_value)) ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
285 (type == GAIM_PREF_BOOLEAN &&
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
286 (gaim_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
287
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
288 gtk_menu_set_active(GTK_MENU(menu), o);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
289 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
290
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
291 menuitems = g_list_next(menuitems);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
292
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
293 o++;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
294 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
295
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
296 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
297 gtk_box_pack_start(GTK_BOX(hbox), dropdown, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
298 gtk_widget_show(dropdown);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
299
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
300 return label;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
301 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
302
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
303 GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
304 gaim_gtk_prefs_dropdown(GtkWidget *box, const gchar *title, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
305 const char *key, ...)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
306 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
307 va_list ap;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
308 GList *menuitems = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
309 GtkWidget *dropdown = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
310 char *name;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
311 int int_value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
312 const char *str_value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
313
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
314 g_return_val_if_fail(type == GAIM_PREF_BOOLEAN || type == GAIM_PREF_INT ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
315 type == GAIM_PREF_STRING, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
316
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
317 va_start(ap, key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
318 while ((name = va_arg(ap, char *)) != NULL) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
319
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
320 menuitems = g_list_prepend(menuitems, name);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
321
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
322 if (type == GAIM_PREF_INT || type == GAIM_PREF_BOOLEAN) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
323 int_value = va_arg(ap, int);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
324 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
325 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
326 else {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
327 str_value = va_arg(ap, const char *);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
328 menuitems = g_list_prepend(menuitems, (char *)str_value);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
329 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
330 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
331 va_end(ap);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
332
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
333 g_return_val_if_fail(menuitems != NULL, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
334
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
335 menuitems = g_list_reverse(menuitems);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
336
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
337 dropdown = gaim_gtk_prefs_dropdown_from_list(box, title, type, key,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
338 menuitems);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
339
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
340 g_list_free(menuitems);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
341
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
342 return dropdown;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
343 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
344
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
345 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
346 delete_prefs(GtkWidget *asdf, void *gdsa)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
347 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
348 /* Close any "select sound" request dialogs */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
349 gaim_request_close_with_handle(prefs);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
350
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
351 /* Unregister callbacks. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
352 gaim_prefs_disconnect_by_handle(prefs);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
353
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
354 prefs = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
355 sound_entry = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
356 debugbutton = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
357 notebook_page = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
358 smiley_theme_store = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
359 if (previous_smiley_row)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
360 gtk_tree_row_reference_free(previous_smiley_row);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
361 previous_smiley_row = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
362
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
363 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
364
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
365 static void smiley_sel(GtkTreeSelection *sel, GtkTreeModel *model) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
366 GtkTreeIter iter;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
367 const char *themename;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
368 char *description;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
369 GValue val;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
370 GtkTreePath *path, *oldpath;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
371 struct smiley_theme *new_theme, *old_theme;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
372
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
373 if (!gtk_tree_selection_get_selected(sel, &model, &iter))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
374 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
375
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
376 old_theme = current_smiley_theme;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
377 val.g_type = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
378 gtk_tree_model_get_value(model, &iter, 3, &val);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
379 path = gtk_tree_model_get_path(model, &iter);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
380 themename = g_value_get_string(&val);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
381 gaim_prefs_set_string("/gaim/gtk/smileys/theme", themename);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
382 g_value_unset (&val);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
383
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
384 /* current_smiley_theme is set in callback for the above pref change */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
385 new_theme = current_smiley_theme;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
386 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
387 "<span size='smaller' foreground='white'>%s</span>",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
388 new_theme->name, new_theme->author, new_theme->desc);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
389 gtk_list_store_set(smiley_theme_store, &iter, 1, description, -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
390 g_free(description);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
391
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
392 if (new_theme != old_theme && previous_smiley_row) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
393 oldpath = gtk_tree_row_reference_get_path(previous_smiley_row);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
394 if (gtk_tree_model_get_iter(model, &iter, oldpath)) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
395 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
396 "<span size='smaller' foreground='dim grey'>%s</span>",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
397 old_theme->name, old_theme->author, old_theme->desc);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
398 gtk_list_store_set(smiley_theme_store, &iter, 1,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
399 description, -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
400 g_free(description);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
401 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
402 gtk_tree_path_free(oldpath);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
403 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
404 if (previous_smiley_row)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
405 gtk_tree_row_reference_free(previous_smiley_row);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
406 previous_smiley_row = gtk_tree_row_reference_new(model, path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
407 gtk_tree_path_free(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
408 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
409
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
410 static GtkTreeRowReference *theme_refresh_theme_list()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
411 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
412 GdkPixbuf *pixbuf;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
413 GSList *themes;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
414 GtkTreeIter iter;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
415 GtkTreeRowReference *row_ref = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
416
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
417 if (previous_smiley_row)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
418 gtk_tree_row_reference_free(previous_smiley_row);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
419 previous_smiley_row = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
420
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
421 gaim_gtkthemes_smiley_theme_probe();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
422
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
423 if (!(themes = smiley_themes))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
424 return NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
425
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
426 gtk_list_store_clear(smiley_theme_store);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
427
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
428 while (themes) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
429 struct smiley_theme *theme = themes->data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
430 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
431 "<span size='smaller' foreground='dim grey'>%s</span>",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
432 theme->name, theme->author, theme->desc);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
433 gtk_list_store_append (smiley_theme_store, &iter);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
434
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
435 /*
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
436 * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
437 * looks like it should be ok to me. Anyone know what's up? --Mark
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
438 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
439 pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, NULL) : NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
440
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
441 gtk_list_store_set(smiley_theme_store, &iter,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
442 0, pixbuf,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
443 1, description,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
444 2, theme->path,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
445 3, theme->name,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
446 -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
447
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
448 if (pixbuf != NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
449 g_object_unref(G_OBJECT(pixbuf));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
450
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
451 g_free(description);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
452 themes = themes->next;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
453
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
454 /* If this is the currently selected theme,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
455 * we will need to select it. Grab the row reference. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
456 if (theme == current_smiley_theme) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
457 GtkTreePath *path = gtk_tree_model_get_path(
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
458 GTK_TREE_MODEL(smiley_theme_store), &iter);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
459 row_ref = gtk_tree_row_reference_new(
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
460 GTK_TREE_MODEL(smiley_theme_store), path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
461 gtk_tree_path_free(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
462 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
463 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
464
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
465 return row_ref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
466 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
467
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
468 static void theme_install_theme(char *path, char *extn) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
469 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
470 gchar *command;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
471 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
472 gchar *destdir;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
473 gchar *tail;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
474 GtkTreeRowReference *theme_rowref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
475
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
476 /* Just to be safe */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
477 g_strchomp(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
478
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
479 /* I dont know what you are, get out of here */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
480 if (extn != NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
481 tail = extn;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
482 else if ((tail = strrchr(path, '.')) == NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
483 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
484
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
485 destdir = g_strconcat(gaim_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
486
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
487 /* We'll check this just to make sure. This also lets us do something different on
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
488 * other platforms, if need be */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
489 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
490 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
491 gchar *path_escaped = g_shell_quote(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
492 gchar *destdir_escaped = g_shell_quote(destdir);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
493 command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
494 g_free(path_escaped);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
495 g_free(destdir_escaped);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
496 #else
14224
ab8a105eff62 [gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 14191
diff changeset
497 if(!gtkwgaim_gz_untar(path, destdir)) {
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
498 g_free(destdir);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
499 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
500 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
501 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
502 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
503 else {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
504 g_free(destdir);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
505 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
506 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
507
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
508 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
509 /* Fire! */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
510 if (system(command))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
511 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
512 gaim_notify_error(NULL, NULL, _("Smiley theme failed to unpack."), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
513 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
514
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
515 g_free(command);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
516 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
517 g_free(destdir);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
518
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
519 theme_rowref = theme_refresh_theme_list();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
520 if (theme_rowref != NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
521 gtk_tree_row_reference_free(theme_rowref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
522 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
523
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
524 static void
14354
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
525 theme_got_url(GaimUtilFetchUrlData *url_data, gpointer user_data,
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
526 const gchar *themedata, size_t len, const gchar *error_message)
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
527 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
528 FILE *f;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
529 gchar *path;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
530
14354
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
531 if ((error_message != NULL) || (len == 0))
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
532 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
533
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
534 f = gaim_mkstemp(&path, TRUE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
535 fwrite(themedata, len, 1, f);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
536 fclose(f);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
537
14354
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
538 theme_install_theme(path, user_data);
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
539
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
540 g_unlink(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
541 g_free(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
542 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
543
14354
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
544 static void
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
545 theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y,
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
546 GtkSelectionData *sd, guint info, guint t, gpointer data)
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
547 {
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
548 gchar *name = (gchar *)sd->data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
549
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
550 if ((sd->length >= 0) && (sd->format == 8)) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
551 /* Well, it looks like the drag event was cool.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
552 * Let's do something with it */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
553
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
554 if (!g_ascii_strncasecmp(name, "file://", 7)) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
555 GError *converr = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
556 gchar *tmp;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
557 /* It looks like we're dealing with a local file. Let's
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
558 * just untar it in the right place */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
559 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
560 gaim_debug(GAIM_DEBUG_ERROR, "theme dnd", "%s\n",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
561 (converr ? converr->message :
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
562 "g_filename_from_uri error"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
563 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
564 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
565 theme_install_theme(tmp, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
566 g_free(tmp);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
567 } else if (!g_ascii_strncasecmp(name, "http://", 7)) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
568 /* Oo, a web drag and drop. This is where things
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
569 * will start to get interesting */
14354
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
570 gaim_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, ".tgz");
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
571 } else if (!g_ascii_strncasecmp(name, "https://", 8)) {
14354
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
572 /* gaim_util_fetch_url() doesn't support HTTPS, but we want users
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
573 * to be able to drag and drop links from the SF trackers, so
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
574 * we'll try it as an HTTP URL. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
575 char *tmp = g_strdup(name + 1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
576 tmp[0] = 'h';
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
577 tmp[1] = 't';
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
578 tmp[2] = 't';
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
579 tmp[3] = 'p';
14354
01daacf7b771 [gaim-migrate @ 17060]
Mark Doliner <mark@kingant.net>
parents: 14224
diff changeset
580 gaim_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, ".tgz");
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
581 g_free(tmp);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
582 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
583
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
584 gtk_drag_finish(dc, TRUE, FALSE, t);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
585 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
586
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
587 gtk_drag_finish(dc, FALSE, FALSE, t);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
588 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
589
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
590 /* Does same as normal sort, except "none" is sorted first */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
591 static gint gaim_sort_smileys (GtkTreeModel *model,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
592 GtkTreeIter *a,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
593 GtkTreeIter *b,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
594 gpointer userdata)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
595 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
596 gint ret = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
597 gchar *name1 = NULL, *name2 = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
598
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
599 gtk_tree_model_get(model, a, 3, &name1, -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
600 gtk_tree_model_get(model, b, 3, &name2, -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
601
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
602 if (name1 == NULL || name2 == NULL) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
603 if (!(name1 == NULL && name2 == NULL))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
604 ret = (name1 == NULL) ? -1: 1;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
605 } else if (!g_ascii_strcasecmp(name1, "none")) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
606 if (!g_utf8_collate(name1, name2))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
607 ret = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
608 else
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
609 /* Sort name1 first */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
610 ret = -1;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
611 } else if (!g_ascii_strcasecmp(name2, "none")) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
612 /* Sort name2 first */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
613 ret = 1;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
614 } else {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
615 /* Neither string is "none", default to normal sort */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
616 ret = g_utf8_collate(name1,name2);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
617 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
618
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
619 g_free(name1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
620 g_free(name2);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
621
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
622 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
623 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
624
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
625 static GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
626 theme_page()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
627 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
628 GtkWidget *ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
629 GtkWidget *sw;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
630 GtkWidget *view;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
631 GtkCellRenderer *rend;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
632 GtkTreeViewColumn *col;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
633 GtkTreeSelection *sel;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
634 GtkTreeRowReference *rowref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
635 GtkWidget *label;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
636 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}};
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
637
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
638 ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
639 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
640
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
641 label = gtk_label_new(_("Select a smiley theme that you would like to use from the list below. New themes can be installed by dragging and dropping them onto the theme list."));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
642
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
643 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
644 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
645 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
646
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
647 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
648 gtk_widget_show(label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
649
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
650 sw = gtk_scrolled_window_new(NULL,NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
651 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
652 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
653
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
654 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
655 smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
656
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
657 rowref = theme_refresh_theme_list();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
658
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
659 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
660
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
661 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
662 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
663
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
664 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
665
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
666 rend = gtk_cell_renderer_pixbuf_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
667 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
668
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
669 /* Custom sort so "none" theme is at top of list */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
670 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_store),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
671 3, gaim_sort_smileys, NULL, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
672
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
673 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
674 3, GTK_SORT_ASCENDING);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
675
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
676 col = gtk_tree_view_column_new_with_attributes (_("Icon"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
677 rend,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
678 "pixbuf", 0,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
679 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
680 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
681
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
682 rend = gtk_cell_renderer_text_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
683 col = gtk_tree_view_column_new_with_attributes (_("Description"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
684 rend,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
685 "markup", 1,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
686 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
687 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
688 g_object_unref(G_OBJECT(smiley_theme_store));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
689 gtk_container_add(GTK_CONTAINER(sw), view);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
690
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
691 g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
692
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
693 if (rowref) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
694 GtkTreePath *path = gtk_tree_row_reference_get_path(rowref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
695 gtk_tree_row_reference_free(rowref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
696 gtk_tree_selection_select_path(sel, path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
697 gtk_tree_path_free(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
698 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
699
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
700 gtk_widget_show_all(ret);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
701
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
702 gaim_set_accessible_label (view, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
703
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
704 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
705 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
706
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
707 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
708 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
709 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
710 gboolean bold, italic, uline;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
711
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
712 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
713 &bold, &italic, &uline);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
714
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
715 if (buttons & GTK_IMHTML_BOLD)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
716 gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold", bold);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
717 if (buttons & GTK_IMHTML_ITALIC)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
718 gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic", italic);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
719 if (buttons & GTK_IMHTML_UNDERLINE)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
720 gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline", uline);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
721
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
722 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
723 gaim_prefs_set_int("/gaim/gtk/conversations/font_size",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
724 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml)));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
725 if (buttons & GTK_IMHTML_FACE) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
726 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
727 if (!face)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
728 face = g_strdup("");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
729
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
730 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", face);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
731 g_free(face);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
732 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
733
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
734 if (buttons & GTK_IMHTML_FORECOLOR) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
735 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
736 if (!color)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
737 color = g_strdup("");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
738
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
739 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", color);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
740 g_free(color);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
741 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
742
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
743 if (buttons & GTK_IMHTML_BACKCOLOR) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
744 char *color;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
745 GObject *object;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
746
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
747 color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
748 if (!color)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
749 color = g_strdup("");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
750
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
751 /* Block the signal to prevent a loop. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
752 object = g_object_ref(G_OBJECT(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
753 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
754 NULL, toolbar);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
755 /* Clear the backcolor. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
756 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
757 /* Unblock the signal. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
758 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
759 NULL, toolbar);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
760 g_object_unref(object);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
761
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
762 /* This will fire a toggle signal and get saved below. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
763 gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
764
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
765 g_free(color);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
766 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
767
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
768 if (buttons & GTK_IMHTML_BACKGROUND) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
769 char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
770 if (!color)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
771 color = g_strdup("");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
772
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
773 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", color);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
774 g_free(color);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
775 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
776 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
777
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
778 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
779 formatting_clear_cb(GtkIMHtml *imhtml, void *data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
780 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
781 gaim_prefs_set_bool("/gaim/gtk/conversations/send_bold", FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
782 gaim_prefs_set_bool("/gaim/gtk/conversations/send_italic", FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
783 gaim_prefs_set_bool("/gaim/gtk/conversations/send_underline", FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
784
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
785 gaim_prefs_set_int("/gaim/gtk/conversations/font_size", 3);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
786
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
787 gaim_prefs_set_string("/gaim/gtk/conversations/font_face", "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
788 gaim_prefs_set_string("/gaim/gtk/conversations/fgcolor", "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
789 gaim_prefs_set_string("/gaim/gtk/conversations/bgcolor", "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
790 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
791
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
792 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
793 conversation_usetabs_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
794 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
795 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
796 gboolean usetabs = GPOINTER_TO_INT(value);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
797
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
798 if (usetabs)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
799 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
800 else
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
801 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
802 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
803
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
804 static GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
805 conv_page()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
806 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
807 GtkWidget *ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
808 GtkWidget *vbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
809 GtkWidget *label;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
810 GList *names = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
811 GtkWidget *frame;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
812 GtkWidget *imhtml;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
813 GtkWidget *toolbar;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
814 GtkWidget *hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
815 GtkWidget *vbox2;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
816 GtkWidget *iconpref1;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
817 GtkWidget *iconpref2;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
818
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
819 ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
820 gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
821
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
822 vbox = gaim_gtk_make_frame(ret, _("Conversations"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
823
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
824 gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
825 GAIM_PREF_STRING, "/gaim/gtk/conversations/im/hide_new",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
826 _("Never"), "never",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
827 _("When away"), "away",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
828 _("Always"), "always",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
829 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
830
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
831 gaim_gtk_prefs_checkbox(_("Send unknown \"_slash\" commands as messages"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
832 "/gaim/gtk/conversations/passthrough_unknown_commands", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
833 gaim_gtk_prefs_checkbox(_("Show _formatting on incoming messages"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
834 "/gaim/gtk/conversations/show_incoming_formatting", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
835
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
836 iconpref1 = gaim_gtk_prefs_checkbox(_("Show buddy _icons"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
837 "/gaim/gtk/conversations/im/show_buddy_icons", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
838 iconpref2 = gaim_gtk_prefs_checkbox(_("Enable buddy ic_on animation"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
839 "/gaim/gtk/conversations/im/animate_buddy_icons", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
840 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/im/show_buddy_icons"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
841 gtk_widget_set_sensitive(iconpref2, FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
842 g_signal_connect(G_OBJECT(iconpref1), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
843 G_CALLBACK(gaim_gtk_toggle_sensitive), iconpref2);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
844
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
845 gaim_gtk_prefs_checkbox(_("_Notify buddies that you are typing to them"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
846 "/core/conversations/im/send_typing", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
847 #ifdef USE_GTKSPELL
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
848 gaim_gtk_prefs_checkbox(_("Highlight _misspelled words"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
849 "/gaim/gtk/conversations/spellcheck", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
850 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
851
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
852 gaim_gtk_prefs_checkbox(_("Use smooth-scrolling"), "/gaim/gtk/conversations/use_smooth_scrolling", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
853
14805
984657c2584d [gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 14647
diff changeset
854 #ifdef _WIN32
984657c2584d [gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 14647
diff changeset
855 gaim_gtk_prefs_checkbox(_("F_lash window when IMs are received"), "/gaim/gtk/win32/blink_im", vbox);
984657c2584d [gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 14647
diff changeset
856 #endif
984657c2584d [gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 14647
diff changeset
857
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
858 frame = gaim_gtk_create_imhtml(TRUE, &imhtml, &toolbar, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
859 gtk_widget_set_name(imhtml, "gaim_gtkprefs_font_imhtml");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
860 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
861 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
862 GTK_IMHTML_BOLD |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
863 GTK_IMHTML_ITALIC |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
864 GTK_IMHTML_UNDERLINE |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
865 GTK_IMHTML_GROW |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
866 GTK_IMHTML_SHRINK |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
867 GTK_IMHTML_FACE |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
868 GTK_IMHTML_FORECOLOR |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
869 GTK_IMHTML_BACKCOLOR |
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
870 GTK_IMHTML_BACKGROUND);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
871
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
872 gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting. :)"), 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
873
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
874 gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
875
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
876 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_bold"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
877 gtk_imhtml_toggle_bold(GTK_IMHTML(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
878 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_italic"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
879 gtk_imhtml_toggle_italic(GTK_IMHTML(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
880 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_underline"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
881 gtk_imhtml_toggle_underline(GTK_IMHTML(imhtml));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
882
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
883 gtk_imhtml_font_set_size(GTK_IMHTML(imhtml), gaim_prefs_get_int("/gaim/gtk/conversations/font_size"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
884 gtk_imhtml_toggle_forecolor(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
885 gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
886 gtk_imhtml_toggle_fontface(GTK_IMHTML(imhtml), gaim_prefs_get_string("/gaim/gtk/conversations/font_face"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
887
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
888 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
889 G_CALLBACK(formatting_toggle_cb), toolbar);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
890 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
891 G_CALLBACK(formatting_clear_cb), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
892
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
893 /* All the tab options! */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
894 vbox = gaim_gtk_make_frame(ret, _("Tab Options"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
895
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
896 gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
897 "/gaim/gtk/conversations/tabs", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
898
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
899 /*
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
900 * Connect a signal to the above preference. When conversations are not
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
901 * shown in a tabbed window then all tabbing options should be disabled.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
902 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
903 vbox2 = gtk_vbox_new(FALSE, 9);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
904 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
905 gaim_prefs_connect_callback(prefs, "/gaim/gtk/conversations/tabs",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
906 conversation_usetabs_cb, vbox2);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
907 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
908 gtk_widget_set_sensitive(vbox2, FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
909
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
910 gaim_gtk_prefs_checkbox(_("Show close b_utton on tabs"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
911 "/gaim/gtk/conversations/close_on_tabs", vbox2);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
912
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
913 hbox = gtk_hbox_new(FALSE, 9);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
914 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
915
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
916 label = gaim_gtk_prefs_dropdown(hbox, _("_Placement:"), GAIM_PREF_INT,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
917 "/gaim/gtk/conversations/tab_side",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
918 _("Top"), GTK_POS_TOP,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
919 _("Bottom"), GTK_POS_BOTTOM,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
920 _("Left"), GTK_POS_LEFT,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
921 _("Right"), GTK_POS_RIGHT,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
922 #if GTK_CHECK_VERSION(2,6,0)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
923 _("Left Vertical"), GTK_POS_LEFT|8,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
924 _("Right Vertical"), GTK_POS_RIGHT|8,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
925 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
926 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
927
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
928 names = gaim_gtkconv_placement_get_options();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
929 label = gaim_gtk_prefs_dropdown_from_list(hbox, _("N_ew conversations:"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
930 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
931 g_list_free(names);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
932
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
933 gtk_widget_show_all(ret);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
934
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
935 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
936 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
937
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
938 static void network_ip_changed(GtkEntry *entry, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
939 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
940 gaim_network_set_public_ip(gtk_entry_get_text(entry));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
941 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
942
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
943 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
944 proxy_changed_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
945 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
946 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
947 GtkWidget *frame = data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
948 const char *proxy = value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
949
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
950 if (strcmp(proxy, "none") && strcmp(proxy, "envvar"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
951 gtk_widget_show_all(frame);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
952 else
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
953 gtk_widget_hide(frame);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
954 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
955
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
956 static void proxy_print_option(GtkEntry *entry, int entrynum)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
957 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
958 if (entrynum == PROXYHOST)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
959 gaim_prefs_set_string("/core/proxy/host", gtk_entry_get_text(entry));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
960 else if (entrynum == PROXYPORT)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
961 gaim_prefs_set_int("/core/proxy/port", atoi(gtk_entry_get_text(entry)));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
962 else if (entrynum == PROXYUSER)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
963 gaim_prefs_set_string("/core/proxy/username", gtk_entry_get_text(entry));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
964 else if (entrynum == PROXYPASS)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
965 gaim_prefs_set_string("/core/proxy/password", gtk_entry_get_text(entry));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
966 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
967
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
968 static GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
969 network_page()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
970 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
971 GtkWidget *ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
972 GtkWidget *vbox, *hbox, *entry;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
973 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
974 GtkSizeGroup *sg;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
975 GaimProxyInfo *proxy_info = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
976
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
977 ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
978 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
979
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
980 vbox = gaim_gtk_make_frame (ret, _("IP Address"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
981 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
982 gaim_gtk_prefs_labeled_entry(vbox,_("ST_UN server:"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
983 "/core/network/stun_server", sg);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
984
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
985 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
986 gtk_container_add(GTK_CONTAINER(vbox), hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
987
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
988 label = gtk_label_new(NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
989 gtk_container_add(GTK_CONTAINER(hbox), label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
990 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
991
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
992 label = gtk_label_new(NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
993 gtk_label_set_markup(GTK_LABEL(label),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
994 _("<span style=\"italic\">Example: stunserver.org</span>"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
995 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
996 gtk_container_add(GTK_CONTAINER(hbox), label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
997
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
998 auto_ip_checkbox = gaim_gtk_prefs_checkbox(_("_Autodetect IP address"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
999 "/core/network/auto_ip", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1000
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1001 table = gtk_table_new(2, 2, FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1002 gtk_container_set_border_width(GTK_CONTAINER(table), 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1003 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1004 gtk_table_set_row_spacings(GTK_TABLE(table), 10);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1005 gtk_container_add(GTK_CONTAINER(vbox), table);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1006
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1007 label = gtk_label_new_with_mnemonic(_("Public _IP:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1008 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1009 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1010 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1011
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1012 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1013 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1014 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1015 g_signal_connect(G_OBJECT(entry), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1016 G_CALLBACK(network_ip_changed), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1017
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1018 /*
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1019 * TODO: This could be better by showing the autodeteced
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1020 * IP separately from the user-specified IP.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1021 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1022 if (gaim_network_get_my_ip(-1) != NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1023 gtk_entry_set_text(GTK_ENTRY(entry),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1024 gaim_network_get_my_ip(-1));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1025
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1026 gaim_set_accessible_label (entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1027
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1028
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1029 if (gaim_prefs_get_bool("/core/network/auto_ip")) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1030 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1031 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1032
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1033 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1034 G_CALLBACK(gaim_gtk_toggle_sensitive), table);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1035
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1036 vbox = gaim_gtk_make_frame (ret, _("Ports"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1037 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1038
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1039 ports_checkbox = gaim_gtk_prefs_checkbox(_("_Manually specify range of ports to listen on"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1040 "/core/network/ports_range_use", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1041
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1042 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_Start port:"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1043 "/core/network/ports_range_start", 0, 65535, sg);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1044 if (!gaim_prefs_get_bool("/core/network/ports_range_use"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1045 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1046 g_signal_connect(G_OBJECT(ports_checkbox), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1047 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1048
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1049 spin_button = gaim_gtk_prefs_labeled_spin_button(vbox, _("_End port:"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1050 "/core/network/ports_range_end", 0, 65535, sg);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1051 if (!gaim_prefs_get_bool("/core/network/ports_range_use"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1052 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1053 g_signal_connect(G_OBJECT(ports_checkbox), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1054 G_CALLBACK(gaim_gtk_toggle_sensitive), spin_button);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1055
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1056 if (!gaim_running_gnome()) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1057 vbox = gaim_gtk_make_frame(ret, _("Proxy Server"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1058 prefs_proxy_frame = gtk_vbox_new(FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1059 gaim_gtk_prefs_dropdown(vbox, _("Proxy _type:"), GAIM_PREF_STRING,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1060 "/core/proxy/type",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1061 _("No proxy"), "none",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1062 "SOCKS 4", "socks4",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1063 "SOCKS 5", "socks5",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1064 "HTTP", "http",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1065 _("Use Environmental Settings"), "envvar",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1066 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1067 gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1068 proxy_info = gaim_global_proxy_get_info();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1069
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1070 gaim_prefs_connect_callback(prefs, "/core/proxy/type",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1071 proxy_changed_cb, prefs_proxy_frame);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1072
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1073 table = gtk_table_new(4, 2, FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1074 gtk_container_set_border_width(GTK_CONTAINER(table), 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1075 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1076 gtk_table_set_row_spacings(GTK_TABLE(table), 10);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1077 gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1078
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1079
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1080 label = gtk_label_new_with_mnemonic(_("_Host:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1081 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1082 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1083
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1084 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1085 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1086 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1087 g_signal_connect(G_OBJECT(entry), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1088 G_CALLBACK(proxy_print_option), (void *)PROXYHOST);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1089
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1090 if (proxy_info != NULL && gaim_proxy_info_get_host(proxy_info))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1091 gtk_entry_set_text(GTK_ENTRY(entry),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1092 gaim_proxy_info_get_host(proxy_info));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1093
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1094 hbox = gtk_hbox_new(TRUE, 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1095 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1096 gaim_set_accessible_label (entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1097
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1098 label = gtk_label_new_with_mnemonic(_("_Port:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1099 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1100 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1101
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1102 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1103 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1104 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1105 g_signal_connect(G_OBJECT(entry), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1106 G_CALLBACK(proxy_print_option), (void *)PROXYPORT);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1107
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1108 if (proxy_info != NULL && gaim_proxy_info_get_port(proxy_info) != 0) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1109 char buf[128];
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1110 g_snprintf(buf, sizeof(buf), "%d",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1111 gaim_proxy_info_get_port(proxy_info));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1112
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1113 gtk_entry_set_text(GTK_ENTRY(entry), buf);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1114 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1115 gaim_set_accessible_label (entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1116
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1117 label = gtk_label_new_with_mnemonic(_("_User:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1118 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1119 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1120
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1121 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1122 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1123 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1124 g_signal_connect(G_OBJECT(entry), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1125 G_CALLBACK(proxy_print_option), (void *)PROXYUSER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1126
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1127 if (proxy_info != NULL && gaim_proxy_info_get_username(proxy_info) != NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1128 gtk_entry_set_text(GTK_ENTRY(entry),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1129 gaim_proxy_info_get_username(proxy_info));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1130
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1131 hbox = gtk_hbox_new(TRUE, 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1132 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1133 gaim_set_accessible_label (entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1134
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1135 label = gtk_label_new_with_mnemonic(_("Pa_ssword:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1136 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1137 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1138
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1139 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1140 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1141 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1142 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1143 gtk_entry_set_invisible_char(GTK_ENTRY(entry), GAIM_INVISIBLE_CHAR);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1144 g_signal_connect(G_OBJECT(entry), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1145 G_CALLBACK(proxy_print_option), (void *)PROXYPASS);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1146
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1147 if (proxy_info != NULL && gaim_proxy_info_get_password(proxy_info) != NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1148 gtk_entry_set_text(GTK_ENTRY(entry),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1149 gaim_proxy_info_get_password(proxy_info));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1150 gaim_set_accessible_label (entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1151 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1152
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1153 gtk_widget_show_all(ret);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1154 if (proxy_info == NULL ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1155 gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_NONE ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1156 gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_USE_ENVVAR)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1157 gtk_widget_hide(table);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1158 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1159 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1160
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1161 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1162 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1163 const char *program = gtk_entry_get_text(GTK_ENTRY(entry));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1164
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1165 gaim_prefs_set_string("/gaim/gtk/browsers/command", program);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1166
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1167 /* carry on normally */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1168 return FALSE;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1169 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1170
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1171 static GList *get_available_browsers()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1172 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1173 struct browser {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1174 char *name;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1175 char *command;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1176 };
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1177
14614
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1178 /* Sorted reverse alphabetically */
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1179 static struct browser possible_browsers[] = {
14614
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1180 {N_("Seamonkey"), "seamonkey"},
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1181 {N_("Opera"), "opera"},
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1182 {N_("Netscape"), "netscape"},
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1183 {N_("Mozilla"), "mozilla"},
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1184 {N_("Konqueror"), "kfmclient"},
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1185 {N_("GNOME Default"), "gnome-open"},
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1186 {N_("Galeon"), "galeon"},
14614
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1187 {N_("Firefox"), "firefox"},
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1188 {N_("Firebird"), "mozilla-firebird"},
45cdf2cf456c [gaim-migrate @ 17342]
Mark Doliner <mark@kingant.net>
parents: 14574
diff changeset
1189 {N_("Epiphany"), "epiphany"}
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1190 };
14615
bddedf8e4653 [gaim-migrate @ 17343]
Mark Doliner <mark@kingant.net>
parents: 14614
diff changeset
1191 static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers);
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1192
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1193 GList *browsers = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1194 int i = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1195 char *browser_setting = (char *)gaim_prefs_get_string("/gaim/gtk/browsers/browser");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1196
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1197 browsers = g_list_prepend(browsers, (gpointer)"custom");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1198 browsers = g_list_prepend(browsers, (gpointer)_("Manual"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1199
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1200 for (i = 0; i < num_possible_browsers; i++) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1201 if (gaim_program_is_valid(possible_browsers[i].command)) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1202 browsers = g_list_prepend(browsers,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1203 possible_browsers[i].command);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1204 browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1205 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1206 browser_setting = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1207 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1208 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1209
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1210 if(browser_setting)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1211 gaim_prefs_set_string("/gaim/gtk/browsers/browser", "custom");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1212
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1213 return browsers;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1214 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1215
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1216 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1217 browser_changed1_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1218 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1219 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1220 GtkWidget *hbox = data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1221 const char *browser = value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1222
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1223 gtk_widget_set_sensitive(hbox, strcmp(browser, "custom"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1224 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1225
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1226 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1227 browser_changed2_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1228 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1229 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1230 GtkWidget *hbox = data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1231 const char *browser = value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1232
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1233 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1234 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1235
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1236 static GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1237 browser_page()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1238 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1239 GtkWidget *ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1240 GtkWidget *vbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1241 GtkWidget *hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1242 GtkWidget *label;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1243 GtkWidget *entry;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1244 GtkSizeGroup *sg;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1245 GList *browsers = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1246
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1247 ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1248 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1249
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1250 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1251 vbox = gaim_gtk_make_frame (ret, _("Browser Selection"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1252
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1253 browsers = get_available_browsers();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1254 if (browsers != NULL) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1255 label = gaim_gtk_prefs_dropdown_from_list(vbox,_("_Browser:"), GAIM_PREF_STRING,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1256 "/gaim/gtk/browsers/browser",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1257 browsers);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1258 g_list_free(browsers);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1259 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1260 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1261
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1262 hbox = gtk_hbox_new(FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1263 label = gaim_gtk_prefs_dropdown(hbox, _("_Open link in:"), GAIM_PREF_INT,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1264 "/gaim/gtk/browsers/place",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1265 _("Browser default"), GAIM_BROWSER_DEFAULT,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1266 _("Existing window"), GAIM_BROWSER_CURRENT,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1267 _("New window"), GAIM_BROWSER_NEW_WINDOW,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1268 _("New tab"), GAIM_BROWSER_NEW_TAB,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1269 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1270 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1271 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1272 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1273
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1274 if (!strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1275 gtk_widget_set_sensitive(hbox, FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1276 gaim_prefs_connect_callback(prefs, "/gaim/gtk/browsers/browser",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1277 browser_changed1_cb, hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1278 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1279
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1280 hbox = gtk_hbox_new(FALSE, 5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1281 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1282 label = gtk_label_new_with_mnemonic(_("_Manual:\n(%s for URL)"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1283 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1284 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1285 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1286
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1287 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1288 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1289
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1290 if (strcmp(gaim_prefs_get_string("/gaim/gtk/browsers/browser"), "custom"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1291 gtk_widget_set_sensitive(hbox, FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1292 gaim_prefs_connect_callback(prefs, "/gaim/gtk/browsers/browser",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1293 browser_changed2_cb, hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1294
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1295 gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1296
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1297 gtk_entry_set_text(GTK_ENTRY(entry),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1298 gaim_prefs_get_string("/gaim/gtk/browsers/command"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1299 g_signal_connect(G_OBJECT(entry), "focus-out-event",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1300 G_CALLBACK(manual_browser_set), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1301 gaim_set_accessible_label (entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1302
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1303 gtk_widget_show_all(ret);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1304 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1305 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1306 #endif /*_WIN32*/
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1307
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1308 static GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1309 logging_page()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1310 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1311 GtkWidget *ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1312 GtkWidget *vbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1313 GList *names;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1314
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1315 ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1316 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1317
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1318 vbox = gaim_gtk_make_frame (ret, _("Logging"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1319 names = gaim_log_logger_get_options();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1320
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1321 gaim_gtk_prefs_dropdown_from_list(vbox, _("Log _format:"), GAIM_PREF_STRING,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1322 "/core/logging/format", names);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1323
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1324 g_list_free(names);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1325
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1326 gaim_gtk_prefs_checkbox(_("Log all _instant messages"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1327 "/core/logging/log_ims", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1328 gaim_gtk_prefs_checkbox(_("Log all c_hats"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1329 "/core/logging/log_chats", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1330 gaim_gtk_prefs_checkbox(_("Log all _status changes to system log"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1331 "/core/logging/log_system", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1332
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1333 gtk_widget_show_all(ret);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1334
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1335 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1336 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1337
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1338 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1339 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1340 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1341 gaim_prefs_set_string("/gaim/gtk/sound/command",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1342 gtk_entry_get_text(GTK_ENTRY(entry)));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1343 return TRUE;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1344 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1345
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1346 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1347 sound_changed1_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1348 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1349 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1350 GtkWidget *hbox = data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1351 const char *method = value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1352
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1353 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1354 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1355
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1356 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1357 sound_changed2_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1358 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1359 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1360 GtkWidget *vbox = data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1361 const char *method = value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1362
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1363 gtk_widget_set_sensitive(vbox, strcmp(method, "none"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1364 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1365
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1366 #ifdef USE_GSTREAMER
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1367 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1368 sound_changed3_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1369 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1370 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1371 GtkWidget *hbox = data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1372 const char *method = value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1373
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1374 gtk_widget_set_sensitive(hbox,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1375 !strcmp(method, "automatic") ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1376 !strcmp(method, "arts") ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1377 !strcmp(method, "esd") ||
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1378 !strcmp(method, "nas"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1379 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1380 #endif /* USE_GSTREAMER */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1381 #endif /* !_WIN32 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1382
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1383
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1384 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1385 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1386 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1387 GtkTreeModel *model = (GtkTreeModel *)data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1388 GtkTreeIter iter;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1389 GtkTreePath *path = gtk_tree_path_new_from_string(pth);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1390 char *pref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1391
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1392 gtk_tree_model_get_iter (model, &iter, path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1393 gtk_tree_model_get (model, &iter,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1394 2, &pref,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1395 -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1396
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1397 gaim_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1398 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1399
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1400 gtk_list_store_set(GTK_LIST_STORE (model), &iter,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1401 0, !gtk_cell_renderer_toggle_get_active(cell),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1402 -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1403
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1404 gtk_tree_path_free(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1405 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1406
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1407 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1408 test_sound(GtkWidget *button, gpointer i_am_NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1409 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1410 char *pref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1411 gboolean temp_value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1412
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1413 pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1414 gaim_gtk_sound_get_event_option(sound_row_sel));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1415
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1416 temp_value = gaim_prefs_get_bool(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1417
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1418 if (!temp_value) gaim_prefs_set_bool(pref, TRUE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1419
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1420 gaim_sound_play_event(sound_row_sel, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1421
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1422 if (!temp_value) gaim_prefs_set_bool(pref, FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1423
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1424 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1425 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1426
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1427 /*
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1428 * Resets a sound file back to default.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1429 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1430 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1431 reset_sound(GtkWidget *button, gpointer i_am_also_NULL)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1432 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1433 gchar *pref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1434
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1435 pref = g_strdup_printf("/gaim/gtk/sound/file/%s",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1436 gaim_gtk_sound_get_event_option(sound_row_sel));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1437 gaim_prefs_set_string(pref, "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1438 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1439
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1440 gtk_entry_set_text(GTK_ENTRY(sound_entry), "(default)");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1441 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1442
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1443 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1444 sound_chosen_cb(void *user_data, const char *filename)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1445 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1446 gchar *pref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1447 int sound;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1448
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1449 sound = GPOINTER_TO_INT(user_data);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1450
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1451 /* Set it -- and forget it */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1452 pref = g_strdup_printf("/gaim/gtk/sound/file/%s",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1453 gaim_gtk_sound_get_event_option(sound));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1454 gaim_prefs_set_string(pref, filename);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1455 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1456
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1457 /*
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1458 * If the sound we just changed is still the currently selected
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1459 * sound, then update the box showing the file name.
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1460 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1461 if (sound == sound_row_sel)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1462 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1463 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1464
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1465 static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1466 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1467 gchar *pref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1468 const char *filename;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1469
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1470 pref = g_strdup_printf("/gaim/gtk/sound/file/%s",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1471 gaim_gtk_sound_get_event_option(sound_row_sel));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1472 filename = gaim_prefs_get_string(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1473 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1474
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1475 if (*filename == '\0')
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1476 filename = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1477
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1478 gaim_request_file(prefs, _("Sound Selection"), filename, FALSE,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1479 G_CALLBACK(sound_chosen_cb), NULL, GINT_TO_POINTER(sound_row_sel));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1480 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1481
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1482 #ifdef USE_GSTREAMER
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1483 static gchar* prefs_sound_volume_format(GtkScale *scale, gdouble val)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1484 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1485 if(val < 15) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1486 return g_strdup_printf(_("Quietest"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1487 } else if(val < 30) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1488 return g_strdup_printf(_("Quieter"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1489 } else if(val < 45) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1490 return g_strdup_printf(_("Quiet"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1491 } else if(val < 55) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1492 return g_strdup_printf(_("Normal"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1493 } else if(val < 70) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1494 return g_strdup_printf(_("Loud"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1495 } else if(val < 85) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1496 return g_strdup_printf(_("Louder"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1497 } else {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1498 return g_strdup_printf(_("Loudest"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1499 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1500 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1501
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1502 static void prefs_sound_volume_changed(GtkRange *range)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1503 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1504 int val = (int)gtk_range_get_value(GTK_RANGE(range));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1505 gaim_prefs_set_int("/gaim/gtk/sound/volume", val);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1506 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1507 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1508
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1509 static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1510 GtkTreeIter iter;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1511 GValue val;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1512 const char *file;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1513 char *pref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1514
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1515 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1516 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1517
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1518 val.g_type = 0;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1519 gtk_tree_model_get_value (model, &iter, 3, &val);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1520 sound_row_sel = g_value_get_uint(&val);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1521
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1522 pref = g_strdup_printf("/gaim/gtk/sound/file/%s",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1523 gaim_gtk_sound_get_event_option(sound_row_sel));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1524 file = gaim_prefs_get_string(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1525 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1526 if (sound_entry)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1527 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1528 g_value_unset (&val);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1529 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1530
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1531 static GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1532 sound_page()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1533 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1534 GtkWidget *ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1535 GtkWidget *vbox, *sw, *button;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1536 GtkSizeGroup *sg;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1537 GtkTreeIter iter;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1538 GtkWidget *event_view;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1539 GtkListStore *event_store;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1540 GtkCellRenderer *rend;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1541 GtkTreeViewColumn *col;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1542 GtkTreeSelection *sel;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1543 GtkTreePath *path;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1544 GtkWidget *hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1545 int j;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1546 const char *file;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1547 char *pref;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1548 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1549 GtkWidget *dd;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1550 GtkWidget *label;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1551 GtkWidget *entry;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1552 const char *cmd;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1553 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1554
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1555 ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1556 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1557
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1558 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1559
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1560 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1561 vbox = gaim_gtk_make_frame (ret, _("Sound Method"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1562 dd = gaim_gtk_prefs_dropdown(vbox, _("_Method:"), GAIM_PREF_STRING,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1563 "/gaim/gtk/sound/method",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1564 _("Console beep"), "beep",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1565 #ifdef USE_GSTREAMER
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1566 _("Automatic"), "automatic",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1567 "Arts", "arts",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1568 "ESD", "esd",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1569 "NAS", "nas",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1570 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1571 _("Command"), "custom",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1572 _("No sounds"), "none",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1573 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1574 gtk_size_group_add_widget(sg, dd);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1575 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1576
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1577 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1578 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1579
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1580 label = gtk_label_new_with_mnemonic(_("Sound c_ommand:\n(%s for filename)"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1581 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1582 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1583 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1584
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1585 entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1586 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1587
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1588 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1589 cmd = gaim_prefs_get_string("/gaim/gtk/sound/command");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1590 if(cmd)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1591 gtk_entry_set_text(GTK_ENTRY(entry), cmd);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1592
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1593 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1594 g_signal_connect(G_OBJECT(entry), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1595 G_CALLBACK(sound_cmd_yeah), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1596
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1597 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1598 sound_changed1_cb, hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1599 gtk_widget_set_sensitive(hbox,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1600 !strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1601 "custom"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1602
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1603 gaim_set_accessible_label (entry, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1604 #endif /* _WIN32 */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1605
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1606 vbox = gaim_gtk_make_frame (ret, _("Sound Options"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1607 gaim_gtk_prefs_checkbox(_("Sounds when conversation has _focus"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1608 "/gaim/gtk/sound/conv_focus", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1609 gaim_gtk_prefs_checkbox(_("_Sounds while away"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1610 "/core/sound/while_away", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1611
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1612 #ifdef USE_GSTREAMER
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1613 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1614 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1615
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1616 label = gtk_label_new_with_mnemonic(_("Volume:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1617 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1618 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1619
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1620 sw = gtk_hscale_new_with_range(0.0, 100.0, 5.0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1621 gtk_range_set_increments(GTK_RANGE(sw), 5.0, 25.0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1622 gtk_range_set_value(GTK_RANGE(sw), gaim_prefs_get_int("/gaim/gtk/sound/volume"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1623 g_signal_connect (G_OBJECT (sw), "format-value",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1624 G_CALLBACK (prefs_sound_volume_format),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1625 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1626 g_signal_connect (G_OBJECT (sw), "value-changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1627 G_CALLBACK (prefs_sound_volume_changed),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1628 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1629 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1630
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1631 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1632 sound_changed3_cb, hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1633 sound_changed3_cb("/gaim/gtk/sound/method", GAIM_PREF_STRING,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1634 gaim_prefs_get_string("/gaim/gtk/sound/method"), hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1635 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1636
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1637 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1638 gtk_widget_set_sensitive(vbox,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1639 strcmp(gaim_prefs_get_string("/gaim/gtk/sound/method"), "none"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1640 gaim_prefs_connect_callback(prefs, "/gaim/gtk/sound/method",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1641 sound_changed2_cb, vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1642 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1643
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1644 vbox = gaim_gtk_make_frame(ret, _("Sound Events"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1645
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1646 /* The following is an ugly hack to make the frame expand so the
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1647 * sound events list is big enough to be usable */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1648 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1649 GTK_PACK_START);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1650 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1651 TRUE, 0, GTK_PACK_START);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1652 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1653 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1654
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1655 sw = gtk_scrolled_window_new(NULL,NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1656 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1657 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1658
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1659 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1660 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1661
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1662 for (j=0; j < GAIM_NUM_SOUNDS; j++) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1663 char *pref = g_strdup_printf("/gaim/gtk/sound/enabled/%s",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1664 gaim_gtk_sound_get_event_option(j));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1665 const char *label = gaim_gtk_sound_get_event_label(j);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1666
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1667 if (label == NULL) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1668 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1669 continue;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1670 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1671
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1672 gtk_list_store_append (event_store, &iter);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1673 gtk_list_store_set(event_store, &iter,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1674 0, gaim_prefs_get_bool(pref),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1675 1, _(label),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1676 2, pref,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1677 3, j,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1678 -1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1679 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1680 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1681
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1682 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1683
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1684 rend = gtk_cell_renderer_toggle_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1685 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1686 g_signal_connect (G_OBJECT (sel), "changed",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1687 G_CALLBACK (prefs_sound_sel),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1688 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1689 g_signal_connect (G_OBJECT(rend), "toggled",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1690 G_CALLBACK(event_toggled), event_store);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1691 path = gtk_tree_path_new_first();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1692 gtk_tree_selection_select_path(sel, path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1693 gtk_tree_path_free(path);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1694
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1695 col = gtk_tree_view_column_new_with_attributes (_("Play"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1696 rend,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1697 "active", 0,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1698 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1699 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1700
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1701 rend = gtk_cell_renderer_text_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1702 col = gtk_tree_view_column_new_with_attributes (_("Event"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1703 rend,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1704 "text", 1,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1705 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1706 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1707 g_object_unref(G_OBJECT(event_store));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1708 gtk_container_add(GTK_CONTAINER(sw), event_view);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1709
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1710 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1711 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1712 sound_entry = gtk_entry_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1713 pref = g_strdup_printf("/gaim/gtk/sound/file/%s",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1714 gaim_gtk_sound_get_event_option(0));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1715 file = gaim_prefs_get_string(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1716 g_free(pref);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1717 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1718 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1719 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1720
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1721 button = gtk_button_new_with_label(_("Test"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1722 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1723 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1724
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1725 button = gtk_button_new_with_label(_("Reset"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1726 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1727 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1728
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1729 button = gtk_button_new_with_label(_("Choose..."));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1730 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1731 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1732 gtk_widget_show_all(ret);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1733
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1734 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1735 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1736
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1737
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1738 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1739 set_idle_away(GaimSavedStatus *status)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1740 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1741 gaim_prefs_set_int("/core/savedstatus/idleaway", gaim_savedstatus_get_creation_time(status));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1742 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1743
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1744 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1745 set_startupstatus(GaimSavedStatus *status)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1746 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1747 gaim_prefs_set_int("/core/savedstatus/startup", gaim_savedstatus_get_creation_time(status));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1748 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1749
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1750 static GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1751 away_page()
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1752 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1753 GtkWidget *ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1754 GtkWidget *vbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1755 GtkWidget *hbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1756 GtkWidget *dd;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1757 GtkWidget *label;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1758 GtkWidget *button;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1759 GtkWidget *select;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1760 GtkWidget *menu;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1761 GtkSizeGroup *sg;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1762
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1763 ret = gtk_vbox_new(FALSE, GAIM_HIG_CAT_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1764 gtk_container_set_border_width (GTK_CONTAINER (ret), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1765
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1766 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1767
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1768 /* Idle stuff */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1769 vbox = gaim_gtk_make_frame(ret, _("Idle"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1770
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1771 dd = gaim_gtk_prefs_dropdown(vbox, _("_Report idle time:"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1772 GAIM_PREF_STRING, "/core/away/idle_reporting",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1773 _("Never"), "none",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1774 _("From last sent message"), "gaim",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1775 #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1776 _("Based on keyboard or mouse use"), "system",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1777 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1778 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1779 gtk_size_group_add_widget(sg, dd);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1780 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1781
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1782 /* Away stuff */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1783 vbox = gaim_gtk_make_frame(ret, _("Away"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1784
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1785 dd = gaim_gtk_prefs_dropdown(vbox, _("_Auto-reply:"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1786 GAIM_PREF_STRING, "/core/away/auto_reply",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1787 _("Never"), "never",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1788 _("When away"), "away",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1789 _("When both away and idle"), "awayidle",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1790 NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1791 gtk_size_group_add_widget(sg, dd);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1792 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1793
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1794 /* Auto-away stuff */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1795 vbox = gaim_gtk_make_frame(ret, _("Auto-away"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1796
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1797 button = gaim_gtk_prefs_checkbox(_("Change status when _idle"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1798 "/core/away/away_when_idle", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1799
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1800 select = gaim_gtk_prefs_labeled_spin_button(vbox,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1801 _("_Minutes before changing status:"), "/core/away/mins_before_away",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1802 1, 24 * 60, sg);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1803 g_signal_connect(G_OBJECT(button), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1804 G_CALLBACK(gaim_gtk_toggle_sensitive), select);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1805
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1806 hbox = gtk_hbox_new(FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1807 gtk_container_add(GTK_CONTAINER(vbox), hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1808
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1809 label = gtk_label_new_with_mnemonic(_("Change _status to:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1810 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1811 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1812 g_signal_connect(G_OBJECT(button), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1813 G_CALLBACK(gaim_gtk_toggle_sensitive), label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1814 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1815
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1816 /* TODO: Show something useful if we don't have any saved statuses. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1817 menu = gaim_gtk_status_menu(gaim_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1818 gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1819 g_signal_connect(G_OBJECT(button), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1820 G_CALLBACK(gaim_gtk_toggle_sensitive), menu);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1821 gtk_label_set_mnemonic_widget(GTK_LABEL(label), menu);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1822
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1823 if (!gaim_prefs_get_bool("/core/away/away_when_idle")) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1824 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1825 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1826 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1827 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1828
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1829 /* Signon status stuff */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1830 vbox = gaim_gtk_make_frame(ret, _("Status at Startup"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1831
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1832 button = gaim_gtk_prefs_checkbox(_("Use status from last _exit at startup"),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1833 "/core/savedstatus/startup_current_status", vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1834
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1835 hbox = gtk_hbox_new(FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1836 gtk_container_add(GTK_CONTAINER(vbox), hbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1837
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1838 label = gtk_label_new_with_mnemonic(_("Status to a_pply at startup:"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1839 gtk_size_group_add_widget(sg, label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1840 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1841 g_signal_connect(G_OBJECT(button), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1842 G_CALLBACK(gaim_gtk_toggle_sensitive), label);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1843 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1844
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1845 /* TODO: Show something useful if we don't have any saved statuses. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1846 menu = gaim_gtk_status_menu(gaim_savedstatus_get_startup(), G_CALLBACK(set_startupstatus));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1847 gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1848 g_signal_connect(G_OBJECT(button), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1849 G_CALLBACK(gaim_gtk_toggle_sensitive), menu);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1850 gtk_label_set_mnemonic_widget(GTK_LABEL(label), menu);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1851
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1852 if (gaim_prefs_get_bool("/core/savedstatus/startup_current_status")) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1853 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1854 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1855 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1856
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1857 gtk_widget_show_all(ret);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1858
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1859 return ret;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1860 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1861
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1862 int prefs_notebook_add_page(const char *text,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1863 GdkPixbuf *pixbuf,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1864 GtkWidget *page,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1865 GtkTreeIter *iter,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1866 GtkTreeIter *parent,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1867 int ind) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1868 GdkPixbuf *icon = NULL;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1869
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1870 if (pixbuf)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1871 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1872
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1873 if (pixbuf)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1874 g_object_unref(pixbuf);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1875 if (icon)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1876 g_object_unref(icon);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1877
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1878 #if GTK_CHECK_VERSION(2,4,0)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1879 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1880 #else
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1881 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1882 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1883 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1884 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1885
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1886 static void prefs_notebook_init() {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1887 GtkTreeIter p, c, c2;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1888 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &c, &p, notebook_page++);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1889 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c2, &c, notebook_page++);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1890 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &c, &p, notebook_page++);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1891 prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1892 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1893 /* We use the registered default browser in windows */
14647
18b74ed00850 [gaim-migrate @ 17393]
Evan Schoenberg <evan.s@dreskin.net>
parents: 14615
diff changeset
1894 /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */
18b74ed00850 [gaim-migrate @ 17393]
Evan Schoenberg <evan.s@dreskin.net>
parents: 14615
diff changeset
1895 if ((gaim_running_gnome() == FALSE) && (gaim_running_osx() == FALSE)) {
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1896 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1897 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1898 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1899 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++);
14841
634014c941ec [gaim-migrate @ 17610]
Mark Doliner <mark@kingant.net>
parents: 14818
diff changeset
1900 prefs_notebook_add_page(_("Status / Idle"), NULL, away_page(), &p, NULL, notebook_page++);
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1901 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1902
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1903 void gaim_gtk_prefs_show(void)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1904 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1905 GtkWidget *vbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1906 GtkWidget *bbox;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1907 GtkWidget *notebook;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1908 GtkWidget *button;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1909
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1910 if (prefs) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1911 gtk_window_present(GTK_WINDOW(prefs));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1912 return;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1913 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1914
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1915 /* copy the preferences to tmp values...
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1916 * I liked "take affect immediately" Oh well :-( */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1917 /* (that should have been "effect," right?) */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1918
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1919 /* Back to instant-apply! I win! BU-HAHAHA! */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1920
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1921 /* Create the window */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1922 prefs = gtk_window_new(GTK_WINDOW_TOPLEVEL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1923 gtk_window_set_role(GTK_WINDOW(prefs), "preferences");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1924 gtk_window_set_title(GTK_WINDOW(prefs), _("Preferences"));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1925 gtk_window_set_resizable (GTK_WINDOW(prefs), FALSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1926 gtk_container_set_border_width(GTK_CONTAINER(prefs), GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1927 g_signal_connect(G_OBJECT(prefs), "destroy",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1928 G_CALLBACK(delete_prefs), NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1929
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1930 vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1931 gtk_container_add(GTK_CONTAINER(prefs), vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1932 gtk_widget_show(vbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1933
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1934 /* The notebook */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1935 prefsnotebook = notebook = gtk_notebook_new ();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1936 gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1937 gtk_widget_show(prefsnotebook);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1938
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1939 /* The buttons to press! */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1940 bbox = gtk_hbutton_box_new();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1941 gtk_box_set_spacing(GTK_BOX(bbox), GAIM_HIG_BOX_SPACE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1942 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1943 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1944 gtk_widget_show (bbox);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1945
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1946 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1947 g_signal_connect_swapped(G_OBJECT(button), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1948 G_CALLBACK(gtk_widget_destroy), prefs);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1949 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1950 gtk_widget_show(button);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1951
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1952 prefs_notebook_init();
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1953
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1954 /* Show everything. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1955 gtk_widget_show(prefs);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1956 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1957
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1958 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1959 set_bool_pref(GtkWidget *w, const char *key)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1960 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1961 gaim_prefs_set_bool(key,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1962 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1963 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1964
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1965 GtkWidget *
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1966 gaim_gtk_prefs_checkbox(const char *text, const char *key, GtkWidget *page)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1967 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1968 GtkWidget *button;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1969
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1970 button = gtk_check_button_new_with_mnemonic(text);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1971 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1972 gaim_prefs_get_bool(key));
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1973
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1974 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1975
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1976 g_signal_connect(G_OBJECT(button), "clicked",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1977 G_CALLBACK(set_bool_pref), (char *)key);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1978
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1979 gtk_widget_show(button);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1980
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1981 return button;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1982 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1983
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1984 static void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1985 smiley_theme_pref_cb(const char *name, GaimPrefType type,
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1986 gconstpointer value, gpointer data)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1987 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1988 const char *themename = value;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1989 GSList *themes;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1990
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1991 for (themes = smiley_themes; themes; themes = themes->next) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1992 struct smiley_theme *smile = themes->data;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1993 if (smile->name && strcmp(themename, smile->name) == 0) {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1994 gaim_gtkthemes_load_smiley_theme(smile->path, TRUE);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1995 break;
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1996 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1997 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1998 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
1999
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2000 void
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2001 gaim_gtk_prefs_init(void)
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2002 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2003 gaim_prefs_add_none("/gaim");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2004 gaim_prefs_add_none("/gaim/gtk");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2005 gaim_prefs_add_none("/plugins/gtk");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2006
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2007 #ifndef _WIN32
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2008 /* Browsers */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2009 gaim_prefs_add_none("/gaim/gtk/browsers");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2010 gaim_prefs_add_int("/gaim/gtk/browsers/place", GAIM_BROWSER_DEFAULT);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2011 gaim_prefs_add_string("/gaim/gtk/browsers/command", "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2012 gaim_prefs_add_string("/gaim/gtk/browsers/browser", "mozilla");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2013 #endif
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2014
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2015 /* Plugins */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2016 gaim_prefs_add_none("/gaim/gtk/plugins");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2017 gaim_prefs_add_string_list("/gaim/gtk/plugins/loaded", NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2018
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2019 /* File locations */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2020 gaim_prefs_add_none("/gaim/gtk/filelocations");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2021 gaim_prefs_add_string("/gaim/gtk/filelocations/last_save_folder", "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2022 gaim_prefs_add_string("/gaim/gtk/filelocations/last_open_folder", "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2023 gaim_prefs_add_string("/gaim/gtk/filelocations/last_icon_folder", "");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2024
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2025 /* Smiley Themes */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2026 gaim_prefs_add_none("/gaim/gtk/smileys");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2027 gaim_prefs_add_string("/gaim/gtk/smileys/theme", "Default");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2028
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2029 /* Smiley Callbacks */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2030 gaim_prefs_connect_callback(prefs, "/gaim/gtk/smileys/theme",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2031 smiley_theme_pref_cb, NULL);
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2032 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2033
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2034 void gaim_gtk_prefs_update_old() {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2035 /* Rename some old prefs */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2036 gaim_prefs_rename("/gaim/gtk/logging/log_ims", "/core/logging/log_ims");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2037 gaim_prefs_rename("/gaim/gtk/logging/log_chats", "/core/logging/log_chats");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2038 gaim_prefs_rename("/core/conversations/placement",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2039 "/gaim/gtk/conversations/placement");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2040
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2041 gaim_prefs_rename("/gaim/gtk/debug/timestamps", "/core/debug/timestamps");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2042 gaim_prefs_rename("/gaim/gtk/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2043
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2044 gaim_prefs_rename_boolean_toggle("/gaim/gtk/conversations/ignore_colors",
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2045 "/gaim/gtk/conversations/show_incoming_formatting");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2046
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2047 /* this string pref moved into the core, try to be friendly */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2048 gaim_prefs_rename("/gaim/gtk/idle/reporting_method", "/core/away/idle_reporting");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2049
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2050 /* Remove some no-longer-used prefs */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2051 gaim_prefs_remove("/gaim/gtk/blist/auto_expand_contacts");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2052 gaim_prefs_remove("/gaim/gtk/blist/button_style");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2053 gaim_prefs_remove("/gaim/gtk/blist/grey_idle_buddies");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2054 gaim_prefs_remove("/gaim/gtk/blist/raise_on_events");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2055 gaim_prefs_remove("/gaim/gtk/blist/show_group_count");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2056 gaim_prefs_remove("/gaim/gtk/blist/show_warning_level");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2057 gaim_prefs_remove("/gaim/gtk/conversations/button_type");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2058 gaim_prefs_remove("/gaim/gtk/conversations/ctrl_enter_sends");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2059 gaim_prefs_remove("/gaim/gtk/conversations/enter_sends");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2060 gaim_prefs_remove("/gaim/gtk/conversations/escape_closes");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2061 gaim_prefs_remove("/gaim/gtk/conversations/html_shortcuts");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2062 gaim_prefs_remove("/gaim/gtk/conversations/icons_on_tabs");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2063 gaim_prefs_remove("/gaim/gtk/conversations/send_formatting");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2064 gaim_prefs_remove("/gaim/gtk/conversations/show_smileys");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2065 gaim_prefs_remove("/gaim/gtk/conversations/show_urls_as_links");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2066 gaim_prefs_remove("/gaim/gtk/conversations/smiley_shortcuts");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2067 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_bgcolor");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2068 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_fgcolor");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2069 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_font");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2070 gaim_prefs_remove("/gaim/gtk/conversations/use_custom_size");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2071 gaim_prefs_remove("/gaim/gtk/conversations/chat/old_tab_complete");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2072 gaim_prefs_remove("/gaim/gtk/conversations/chat/tab_completion");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2073 gaim_prefs_remove("/gaim/gtk/conversations/im/hide_on_send");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2074 gaim_prefs_remove("/gaim/gtk/conversations/chat/color_nicks");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2075 gaim_prefs_remove("/gaim/gtk/conversations/chat/raise_on_events");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2076 gaim_prefs_remove("/gaim/gtk/conversations/ignore_fonts");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2077 gaim_prefs_remove("/gaim/gtk/conversations/ignore_font_sizes");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2078 gaim_prefs_remove("/gaim/gtk/idle");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2079 gaim_prefs_remove("/gaim/gtk/logging/individual_logs");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2080 gaim_prefs_remove("/gaim/gtk/sound/signon");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2081 gaim_prefs_remove("/gaim/gtk/sound/silent_signon");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2082
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2083 /* Convert old queuing prefs to hide_new 3-way pref. */
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2084 if (gaim_prefs_exists("/plugins/gtk/docklet/queue_messages") &&
14574
333989477bcd [gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents: 14354
diff changeset
2085 gaim_prefs_get_bool("/plugins/gtk/docklet/queue_messages"))
14191
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2086 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2087 gaim_prefs_set_string("/gaim/gtk/conversations/im/hide_new", "always");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2088 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2089 else if (gaim_prefs_exists("/gaim/gtk/away/queue_messages") &&
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2090 gaim_prefs_get_bool("/gaim/gtk/away/queue_messages"))
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2091 {
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2092 gaim_prefs_set_string("/gaim/gtk/conversations/im/hide_new", "away");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2093 }
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2094 gaim_prefs_remove("/gaim/gtk/away/queue_messages");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2095 gaim_prefs_remove("/gaim/gtk/away");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2096 gaim_prefs_remove("/plugins/gtk/docklet/queue_messages");
009db0b357b5 This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
diff changeset
2097 }