pidgin/gtkprefs.c

Thu, 11 Sep 2008 21:12:24 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Thu, 11 Sep 2008 21:12:24 +0000
changeset 24284
ff4a5bfdab7f
parent 24280
3ddbca0498b2
child 24533
37232ecf7246
child 24549
fbc30f6d8fb3
child 26142
20ed0b892829
permissions
-rw-r--r--

disapproval of revision '3ddbca0498b2774da7d7321895e19521d667cffa'

22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1 /**
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2 * @file gtkprefs.c GTK+ Preferences
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3 * @ingroup pidgin
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
5
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
6 /* pidgin
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
7 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
8 * Pidgin is the legal property of its developers, whose names are too numerous
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
10 * source distribution.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
11 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
12 * This program is free software; you can redistribute it and/or modify
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
13 * it under the terms of the GNU General Public License as published by
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
15 * (at your option) any later version.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
16 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
17 * This program is distributed in the hope that it will be useful,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
20 * GNU General Public License for more details.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
21 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
22 * You should have received a copy of the GNU General Public License
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
23 * along with this program; if not, write to the Free Software
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
25 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
26 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
27 #include "internal.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
28 #include "pidgin.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
29
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
30 #include "debug.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
31 #include "notify.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
32 #include "prefs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
33 #include "proxy.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
34 #include "prpl.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
35 #include "request.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
36 #include "savedstatuses.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
37 #include "sound.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
38 #include "util.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
39 #include "network.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
40
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
41 #include "gtkblist.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
42 #include "gtkconv.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
43 #include "gtkdebug.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
44 #include "gtkdialogs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
45 #include "gtkimhtml.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
46 #include "gtkimhtmltoolbar.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
47 #include "gtkprefs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
48 #include "gtksavedstatuses.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
49 #include "gtksound.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
50 #include "gtkthemes.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
51 #include "gtkutils.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
52 #include "pidginstock.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
53
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
54 #define PROXYHOST 0
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
55 #define PROXYPORT 1
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
56 #define PROXYUSER 2
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
57 #define PROXYPASS 3
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
58
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
59 static int sound_row_sel = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
60 static GtkWidget *prefsnotebook;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
61
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
62 static GtkWidget *sound_entry = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
63 static GtkListStore *smiley_theme_store = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
64 static GtkTreeSelection *smiley_theme_sel = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
65 static GtkWidget *prefs_proxy_frame = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
66
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
67 static GtkWidget *prefs = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
68 static GtkWidget *debugbutton = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
69 static int notebook_page = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
70 static GtkTreeRowReference *previous_smiley_row = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
71
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
72 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
73 * PROTOTYPES
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
74 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
75 static void delete_prefs(GtkWidget *, void *);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
76
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
77 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
78 update_spin_value(GtkWidget *w, GtkWidget *spin)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
79 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
80 const char *key = g_object_get_data(G_OBJECT(spin), "val");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
81 int value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
82
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
83 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
84
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
85 purple_prefs_set_int(key, value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
86 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
87
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
88 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
89 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
90 const char *key, int min, int max, GtkSizeGroup *sg)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
91 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
92 GtkWidget *spin;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
93 GtkObject *adjust;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
94 int val;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
95
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
96 val = purple_prefs_get_int(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
97
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
98 adjust = gtk_adjustment_new(val, min, max, 1, 1, 1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
99 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
100 g_object_set_data(G_OBJECT(spin), "val", (char *)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
101 if (max < 10000)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
102 gtk_widget_set_size_request(spin, 50, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
103 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
104 gtk_widget_set_size_request(spin, 60, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
105 g_signal_connect(G_OBJECT(adjust), "value-changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
106 G_CALLBACK(update_spin_value), GTK_WIDGET(spin));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
107 gtk_widget_show(spin);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
108
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
109 return pidgin_add_widget_to_vbox(GTK_BOX(box), title, sg, spin, FALSE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
110 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
111
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
112 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
113 entry_set(GtkEntry *entry, gpointer data) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
114 const char *key = (const char*)data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
115
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
116 purple_prefs_set_string(key, gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
117 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
118
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
119 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
120 pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
121 const char *key, GtkSizeGroup *sg)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
122 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
123 GtkWidget *entry;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
124 const gchar *value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
125
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
126 value = purple_prefs_get_string(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
127
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
128 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
129 gtk_entry_set_text(GTK_ENTRY(entry), value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
130 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
131 G_CALLBACK(entry_set), (char*)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
132 gtk_widget_show(entry);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
133
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
134 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
135 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
136
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
137 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
138 dropdown_set(GObject *w, const char *key)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
139 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
140 const char *str_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
141 int int_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
142 PurplePrefType type;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
143
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
144 type = GPOINTER_TO_INT(g_object_get_data(w, "type"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
145
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
146 if (type == PURPLE_PREF_INT) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
147 int_value = GPOINTER_TO_INT(g_object_get_data(w, "value"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
148
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
149 purple_prefs_set_int(key, int_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
150 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
151 else if (type == PURPLE_PREF_STRING) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
152 str_value = (const char *)g_object_get_data(w, "value");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
153
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
154 purple_prefs_set_string(key, str_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
155 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
156 else if (type == PURPLE_PREF_BOOLEAN) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
157 purple_prefs_set_bool(key,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
158 GPOINTER_TO_INT(g_object_get_data(w, "value")));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
159 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
160 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
161
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
162 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
163 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
164 PurplePrefType type, const char *key, GList *menuitems)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
165 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
166 GtkWidget *dropdown, *opt, *menu;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
167 GtkWidget *label = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
168 gchar *text;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
169 const char *stored_str = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
170 int stored_int = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
171 int int_value = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
172 const char *str_value = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
173 int o = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
174
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
175 g_return_val_if_fail(menuitems != NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
176
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
177 #if 0 /* GTK_CHECK_VERSION(2,4,0) */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
178 if(type == PURPLE_PREF_INT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
179 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
180 else if(type == PURPLE_PREF_STRING)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
181 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
182 dropdown = gtk_combo_box_new_with_model(model);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
183 #else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
184 dropdown = gtk_option_menu_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
185 menu = gtk_menu_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
186 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
187
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
188 if (type == PURPLE_PREF_INT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
189 stored_int = purple_prefs_get_int(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
190 else if (type == PURPLE_PREF_STRING)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
191 stored_str = purple_prefs_get_string(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
192
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
193 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
194 menuitems = g_list_next(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
195 g_return_val_if_fail(menuitems != NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
196
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
197 opt = gtk_menu_item_new_with_label(text);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
198
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
199 g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
200
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
201 if (type == PURPLE_PREF_INT) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
202 int_value = GPOINTER_TO_INT(menuitems->data);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
203 g_object_set_data(G_OBJECT(opt), "value",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
204 GINT_TO_POINTER(int_value));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
205 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
206 else if (type == PURPLE_PREF_STRING) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
207 str_value = (const char *)menuitems->data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
208
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
209 g_object_set_data(G_OBJECT(opt), "value", (char *)str_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
210 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
211 else if (type == PURPLE_PREF_BOOLEAN) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
212 g_object_set_data(G_OBJECT(opt), "value",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
213 menuitems->data);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
214 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
215
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
216 g_signal_connect(G_OBJECT(opt), "activate",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
217 G_CALLBACK(dropdown_set), (char *)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
218
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
219 gtk_widget_show(opt);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
220 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
221
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
222 if ((type == PURPLE_PREF_INT && stored_int == int_value) ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
223 (type == PURPLE_PREF_STRING && stored_str != NULL &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
224 !strcmp(stored_str, str_value)) ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
225 (type == PURPLE_PREF_BOOLEAN &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
226 (purple_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
227
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
228 gtk_menu_set_active(GTK_MENU(menu), o);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
229 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
230
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
231 menuitems = g_list_next(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
232
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
233 o++;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
234 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
235
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
236 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
237
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
238 pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
239
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
240 return label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
241 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
242
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
243 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
244 pidgin_prefs_dropdown(GtkWidget *box, const gchar *title, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
245 const char *key, ...)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
246 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
247 va_list ap;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
248 GList *menuitems = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
249 GtkWidget *dropdown = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
250 char *name;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
251 int int_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
252 const char *str_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
253
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
254 g_return_val_if_fail(type == PURPLE_PREF_BOOLEAN || type == PURPLE_PREF_INT ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
255 type == PURPLE_PREF_STRING, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
256
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
257 va_start(ap, key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
258 while ((name = va_arg(ap, char *)) != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
259
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
260 menuitems = g_list_prepend(menuitems, name);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
261
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
262 if (type == PURPLE_PREF_INT || type == PURPLE_PREF_BOOLEAN) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
263 int_value = va_arg(ap, int);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
264 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
265 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
266 else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
267 str_value = va_arg(ap, const char *);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
268 menuitems = g_list_prepend(menuitems, (char *)str_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
269 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
270 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
271 va_end(ap);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
272
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
273 g_return_val_if_fail(menuitems != NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
274
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
275 menuitems = g_list_reverse(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
276
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
277 dropdown = pidgin_prefs_dropdown_from_list(box, title, type, key,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
278 menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
279
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
280 g_list_free(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
281
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
282 return dropdown;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
283 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
284
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
285 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
286 delete_prefs(GtkWidget *asdf, void *gdsa)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
287 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
288 /* Close any "select sound" request dialogs */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
289 purple_request_close_with_handle(prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
290
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
291 /* Unregister callbacks. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
292 purple_prefs_disconnect_by_handle(prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
293
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
294 prefs = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
295 sound_entry = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
296 debugbutton = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
297 notebook_page = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
298 smiley_theme_store = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
299 if (previous_smiley_row)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
300 gtk_tree_row_reference_free(previous_smiley_row);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
301 previous_smiley_row = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
302
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
303 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
304
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
305 static void smiley_sel(GtkTreeSelection *sel, GtkTreeModel *model) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
306 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
307 const char *themename;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
308 char *description;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
309 GValue val;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
310 GtkTreePath *path, *oldpath;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
311 struct smiley_theme *new_theme, *old_theme;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
312 GtkWidget *remove_button = g_object_get_data(G_OBJECT(sel), "remove_button");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
313
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
314 if (!gtk_tree_selection_get_selected(sel, &model, &iter)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
315 gtk_widget_set_sensitive(remove_button, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
316 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
317 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
318
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
319 old_theme = current_smiley_theme;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
320 val.g_type = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
321 gtk_tree_model_get_value(model, &iter, 3, &val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
322 path = gtk_tree_model_get_path(model, &iter);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
323 themename = g_value_get_string(&val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
324 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", themename);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
325
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
326 gtk_widget_set_sensitive(remove_button, (strcmp(themename, "none") &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
327 strcmp(themename, _("Default"))));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
328 g_value_unset (&val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
329
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
330 /* current_smiley_theme is set in callback for the above pref change */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
331 new_theme = current_smiley_theme;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
332 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
333 "<span size='smaller' foreground='white'>%s</span>",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
334 _(new_theme->name), _(new_theme->author), _(new_theme->desc));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
335 gtk_list_store_set(smiley_theme_store, &iter, 1, description, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
336 g_free(description);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
337
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
338 if (new_theme != old_theme && previous_smiley_row) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
339 oldpath = gtk_tree_row_reference_get_path(previous_smiley_row);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
340 if (gtk_tree_model_get_iter(model, &iter, oldpath)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
341 description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
342 "<span size='smaller' foreground='dim grey'>%s</span>",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
343 _(old_theme->name), _(old_theme->author), _(old_theme->desc));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
344 gtk_list_store_set(smiley_theme_store, &iter, 1,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
345 description, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
346 g_free(description);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
347 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
348 gtk_tree_path_free(oldpath);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
349 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
350 if (previous_smiley_row)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
351 gtk_tree_row_reference_free(previous_smiley_row);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
352 previous_smiley_row = gtk_tree_row_reference_new(model, path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
353 gtk_tree_path_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
354 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
355
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
356 static GtkTreeRowReference *theme_refresh_theme_list(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
357 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
358 GdkPixbuf *pixbuf;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
359 GSList *themes;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
360 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
361 GtkTreeRowReference *row_ref = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
362
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
363 if (previous_smiley_row)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
364 gtk_tree_row_reference_free(previous_smiley_row);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
365 previous_smiley_row = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
366
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
367 pidgin_themes_smiley_theme_probe();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
368
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
369 if (!(themes = smiley_themes))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
370 return NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
371
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
372 gtk_list_store_clear(smiley_theme_store);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
373
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
374 while (themes) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
375 struct smiley_theme *theme = themes->data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
376 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
377 "<span size='smaller' foreground='dim grey'>%s</span>",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
378 _(theme->name), _(theme->author), _(theme->desc));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
379 gtk_list_store_append (smiley_theme_store, &iter);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
380
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
381 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
382 * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
383 * looks like it should be ok to me. Anyone know what's up? --Mark
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
384 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
385 pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, NULL) : NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
386
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
387 gtk_list_store_set(smiley_theme_store, &iter,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
388 0, pixbuf,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
389 1, description,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
390 2, theme->path,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
391 3, theme->name,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
392 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
393
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
394 if (pixbuf != NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
395 g_object_unref(G_OBJECT(pixbuf));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
396
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
397 g_free(description);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
398 themes = themes->next;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
399
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
400 /* If this is the currently selected theme,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
401 * we will need to select it. Grab the row reference. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
402 if (theme == current_smiley_theme) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
403 GtkTreePath *path = gtk_tree_model_get_path(
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
404 GTK_TREE_MODEL(smiley_theme_store), &iter);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
405 row_ref = gtk_tree_row_reference_new(
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
406 GTK_TREE_MODEL(smiley_theme_store), path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
407 gtk_tree_path_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
408 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
409 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
410
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
411 return row_ref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
412 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
413
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
414 static void theme_install_theme(char *path, char *extn) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
415 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
416 gchar *command;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
417 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
418 gchar *destdir;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
419 gchar *tail;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
420 GtkTreeRowReference *theme_rowref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
421
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
422 /* Just to be safe */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
423 g_strchomp(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
424
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
425 /* I dont know what you are, get out of here */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
426 if (extn != NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
427 tail = extn;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
428 else if ((tail = strrchr(path, '.')) == NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
429 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
430
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
431 destdir = g_strconcat(purple_user_dir(), G_DIR_SEPARATOR_S "smileys", NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
432
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
433 /* We'll check this just to make sure. This also lets us do something different on
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
434 * other platforms, if need be */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
435 if (!g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
436 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
437 gchar *path_escaped = g_shell_quote(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
438 gchar *destdir_escaped = g_shell_quote(destdir);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
439 command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
440 g_free(path_escaped);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
441 g_free(destdir_escaped);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
442 #else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
443 if(!winpidgin_gz_untar(path, destdir)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
444 g_free(destdir);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
445 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
446 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
447 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
448 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
449 else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
450 g_free(destdir);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
451 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
452 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
453
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
454 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
455 /* Fire! */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
456 if (system(command))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
457 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
458 purple_notify_error(NULL, NULL, _("Smiley theme failed to unpack."), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
459 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
460
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
461 g_free(command);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
462 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
463 g_free(destdir);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
464
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
465 theme_rowref = theme_refresh_theme_list();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
466 if (theme_rowref != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
467 GtkTreePath *tp = gtk_tree_row_reference_get_path(theme_rowref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
468
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
469 if (tp)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
470 gtk_tree_selection_select_path(smiley_theme_sel, tp);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
471 gtk_tree_row_reference_free(theme_rowref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
472 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
473 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
474
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
475 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
476 theme_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
477 const gchar *themedata, size_t len, const gchar *error_message)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
478 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
479 FILE *f;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
480 gchar *path;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
481 size_t wc;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
482
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
483 if ((error_message != NULL) || (len == 0))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
484 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
485
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
486 f = purple_mkstemp(&path, TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
487 wc = fwrite(themedata, len, 1, f);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
488 if (wc != 1) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
489 purple_debug_warning("theme_got_url", "Unable to write theme data.\n");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
490 fclose(f);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
491 g_unlink(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
492 g_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
493 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
494 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
495 fclose(f);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
496
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
497 theme_install_theme(path, user_data);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
498
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
499 g_unlink(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
500 g_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
501 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
502
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
503 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
504 theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
505 GtkSelectionData *sd, guint info, guint t, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
506 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
507 gchar *name = (gchar *)sd->data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
508
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
509 if ((sd->length >= 0) && (sd->format == 8)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
510 /* Well, it looks like the drag event was cool.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
511 * Let's do something with it */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
512
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
513 if (!g_ascii_strncasecmp(name, "file://", 7)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
514 GError *converr = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
515 gchar *tmp;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
516 /* It looks like we're dealing with a local file. Let's
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
517 * just untar it in the right place */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
518 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
519 purple_debug(PURPLE_DEBUG_ERROR, "theme dnd", "%s\n",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
520 (converr ? converr->message :
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
521 "g_filename_from_uri error"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
522 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
523 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
524 theme_install_theme(tmp, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
525 g_free(tmp);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
526 } else if (!g_ascii_strncasecmp(name, "http://", 7)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
527 /* Oo, a web drag and drop. This is where things
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
528 * will start to get interesting */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
529 purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, ".tgz");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
530 } else if (!g_ascii_strncasecmp(name, "https://", 8)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
531 /* purple_util_fetch_url() doesn't support HTTPS, but we want users
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
532 * to be able to drag and drop links from the SF trackers, so
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
533 * we'll try it as an HTTP URL. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
534 char *tmp = g_strdup(name + 1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
535 tmp[0] = 'h';
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
536 tmp[1] = 't';
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
537 tmp[2] = 't';
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
538 tmp[3] = 'p';
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
539 purple_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, ".tgz");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
540 g_free(tmp);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
541 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
542
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
543 gtk_drag_finish(dc, TRUE, FALSE, t);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
544 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
545
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
546 gtk_drag_finish(dc, FALSE, FALSE, t);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
547 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
548
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
549 /* Does same as normal sort, except "none" is sorted first */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
550 static gint pidgin_sort_smileys (GtkTreeModel *model,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
551 GtkTreeIter *a,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
552 GtkTreeIter *b,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
553 gpointer userdata)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
554 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
555 gint ret = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
556 gchar *name1 = NULL, *name2 = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
557
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
558 gtk_tree_model_get(model, a, 3, &name1, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
559 gtk_tree_model_get(model, b, 3, &name2, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
560
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
561 if (name1 == NULL || name2 == NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
562 if (!(name1 == NULL && name2 == NULL))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
563 ret = (name1 == NULL) ? -1: 1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
564 } else if (!g_ascii_strcasecmp(name1, "none")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
565 if (!g_utf8_collate(name1, name2))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
566 ret = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
567 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
568 /* Sort name1 first */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
569 ret = -1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
570 } else if (!g_ascii_strcasecmp(name2, "none")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
571 /* Sort name2 first */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
572 ret = 1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
573 } else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
574 /* Neither string is "none", default to normal sort */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
575 ret = purple_utf8_strcasecmp(name1,name2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
576 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
577
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
578 g_free(name1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
579 g_free(name2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
580
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
581 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
582 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
583
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
584 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
585 request_theme_file_name_cb(gpointer data, char *theme_file_name)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
586 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
587 theme_install_theme(theme_file_name, NULL) ;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
588 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
589
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
590 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
591 add_theme_button_clicked_cb(GtkWidget *widget, gpointer null)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
592 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
593 purple_request_file(NULL, _("Install Theme"), NULL, FALSE, (GCallback)request_theme_file_name_cb, NULL, NULL, NULL, NULL, NULL) ;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
594 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
595
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
596 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
597 remove_theme_button_clicked_cb(GtkWidget *button, GtkTreeView *tv)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
598 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
599 char *theme_name = NULL, *theme_file = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
600 GtkTreeModel *tm;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
601 GtkTreeIter itr;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
602 GtkTreeRowReference *trr = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
603
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
604 if ((tm = gtk_tree_view_get_model(tv)) == NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
605 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
606 if (!gtk_tree_selection_get_selected(smiley_theme_sel, NULL, &itr))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
607 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
608 gtk_tree_model_get(tm, &itr, 2, &theme_file, 3, &theme_name, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
609
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
610 if (theme_file && theme_name && strcmp(theme_name, "none"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
611 pidgin_themes_remove_smiley_theme(theme_file);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
612
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
613 if ((trr = theme_refresh_theme_list()) != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
614 GtkTreePath *tp = gtk_tree_row_reference_get_path(trr);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
615
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
616 if (tp) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
617 gtk_tree_selection_select_path(smiley_theme_sel, tp);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
618 gtk_tree_path_free(tp);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
619 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
620 gtk_tree_row_reference_free(trr);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
621 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
622
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
623 g_free(theme_file);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
624 g_free(theme_name);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
625 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
626
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
627 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
628 theme_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
629 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
630 GtkWidget *add_button, *remove_button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
631 GtkWidget *hbox_buttons;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
632 GtkWidget *alignment;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
633 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
634 GtkWidget *sw;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
635 GtkWidget *view;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
636 GtkCellRenderer *rend;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
637 GtkTreeViewColumn *col;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
638 GtkTreeSelection *sel;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
639 GtkTreeRowReference *rowref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
640 GtkWidget *label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
641 GtkTargetEntry te[3] = {{"text/plain", 0, 0},{"text/uri-list", 0, 1},{"STRING", 0, 2}};
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
642
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
643 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
644 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
645
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
646 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."));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
647
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
648 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
649 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
650 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
651
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
652 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
653 gtk_widget_show(label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
654
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
655 sw = gtk_scrolled_window_new(NULL,NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
656 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
657 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
658
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
659 gtk_box_pack_start(GTK_BOX(ret), sw, TRUE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
660 smiley_theme_store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
661
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
662 rowref = theme_refresh_theme_list();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
663
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
664 view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(smiley_theme_store));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
665
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
666 gtk_drag_dest_set(view, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
667 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
668
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
669 g_signal_connect(G_OBJECT(view), "drag_data_received", G_CALLBACK(theme_dnd_recv), smiley_theme_store);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
670
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
671 rend = gtk_cell_renderer_pixbuf_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
672 smiley_theme_sel = sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
673
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
674 /* Custom sort so "none" theme is at top of list */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
675 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(smiley_theme_store),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
676 3, pidgin_sort_smileys, NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
677
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
678 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(smiley_theme_store),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
679 3, GTK_SORT_ASCENDING);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
680
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
681 col = gtk_tree_view_column_new_with_attributes (_("Icon"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
682 rend,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
683 "pixbuf", 0,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
684 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
685 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
686
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
687 rend = gtk_cell_renderer_text_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
688 col = gtk_tree_view_column_new_with_attributes (_("Description"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
689 rend,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
690 "markup", 1,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
691 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
692 gtk_tree_view_append_column (GTK_TREE_VIEW(view), col);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
693 g_object_unref(G_OBJECT(smiley_theme_store));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
694 gtk_container_add(GTK_CONTAINER(sw), view);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
695
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
696 g_signal_connect(G_OBJECT(sel), "changed", G_CALLBACK(smiley_sel), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
697
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
698 alignment = gtk_alignment_new(1.0, 0.5, 0.0, 1.0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
699 gtk_widget_show(alignment);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
700 gtk_box_pack_start(GTK_BOX(ret), alignment, FALSE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
701
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
702 hbox_buttons = gtk_hbox_new(TRUE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
703 gtk_widget_show(hbox_buttons);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
704 gtk_container_add(GTK_CONTAINER(alignment), hbox_buttons);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
705
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
706 add_button = gtk_button_new_from_stock(GTK_STOCK_ADD);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
707 gtk_widget_show(add_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
708 gtk_box_pack_start(GTK_BOX(hbox_buttons), add_button, FALSE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
709 g_signal_connect(G_OBJECT(add_button), "clicked", (GCallback)add_theme_button_clicked_cb, view);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
710
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
711 remove_button = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
712 gtk_widget_show(remove_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
713 gtk_box_pack_start(GTK_BOX(hbox_buttons), remove_button, FALSE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
714 g_signal_connect(G_OBJECT(remove_button), "clicked", (GCallback)remove_theme_button_clicked_cb, view);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
715 g_object_set_data(G_OBJECT(sel), "remove_button", remove_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
716
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
717 if (rowref) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
718 GtkTreePath *path = gtk_tree_row_reference_get_path(rowref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
719 gtk_tree_row_reference_free(rowref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
720 gtk_tree_selection_select_path(sel, path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
721 gtk_tree_path_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
722 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
723
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
724 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
725
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
726 pidgin_set_accessible_label (view, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
727
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
728 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
729 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
730
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
731 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
732 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
733 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
734 gboolean bold, italic, uline;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
735
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
736 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
737 &bold, &italic, &uline);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
738
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
739 if (buttons & GTK_IMHTML_BOLD)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
740 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
741 if (buttons & GTK_IMHTML_ITALIC)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
742 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
743 if (buttons & GTK_IMHTML_UNDERLINE)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
744 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
745
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
746 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
747 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
748 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
749 if (buttons & GTK_IMHTML_FACE) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
750 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
751 if (!face)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
752 face = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
753
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
754 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
755 g_free(face);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
756 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
757
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
758 if (buttons & GTK_IMHTML_FORECOLOR) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
759 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
760 if (!color)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
761 color = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
762
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
763 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
764 g_free(color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
765 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
766
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
767 if (buttons & GTK_IMHTML_BACKCOLOR) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
768 char *color;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
769 GObject *object;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
770
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
771 color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
772 if (!color)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
773 color = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
774
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
775 /* Block the signal to prevent a loop. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
776 object = g_object_ref(G_OBJECT(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
777 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
778 NULL, toolbar);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
779 /* Clear the backcolor. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
780 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
781 /* Unblock the signal. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
782 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
783 NULL, toolbar);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
784 g_object_unref(object);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
785
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
786 /* This will fire a toggle signal and get saved below. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
787 gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
788
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
789 g_free(color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
790 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
791
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
792 if (buttons & GTK_IMHTML_BACKGROUND) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
793 char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
794 if (!color)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
795 color = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
796
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
797 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
798 g_free(color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
799 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
800 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
801
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
802 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
803 formatting_clear_cb(GtkIMHtml *imhtml, void *data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
804 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
805 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
806 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
807 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
808
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
809 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
810
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
811 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
812 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
813 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
814 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
815
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
816 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
817 conversation_usetabs_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
818 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
819 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
820 gboolean usetabs = GPOINTER_TO_INT(value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
821
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
822 if (usetabs)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
823 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
824 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
825 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
826 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
827
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
828
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
829 #define CONVERSATION_CLOSE_ACCEL_PATH "<main>/Conversation/Close"
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
830
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
831 /* Filled in in keyboard_shortcuts(). */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
832 static GtkAccelKey ctrl_w = { 0, 0, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
833 static GtkAccelKey escape = { 0, 0, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
834
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
835 static guint escape_closes_conversation_cb_id = 0;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
836
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
837 static gboolean
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
838 accel_is_escape(GtkAccelKey *k)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
839 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
840 return (k->accel_key == escape.accel_key
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
841 && k->accel_mods == escape.accel_mods);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
842 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
843
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
844 /* Update the tickybox in Preferences when the keybinding for Conversation ->
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
845 * Close is changed via Gtk.
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
846 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
847 static void
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
848 conversation_close_accel_changed_cb (GtkAccelMap *object,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
849 gchar *accel_path,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
850 guint accel_key,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
851 GdkModifierType accel_mods,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
852 gpointer checkbox_)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
853 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
854 GtkToggleButton *checkbox = GTK_TOGGLE_BUTTON(checkbox_);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
855 GtkAccelKey new = { accel_key, accel_mods, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
856
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
857 g_signal_handler_block(checkbox, escape_closes_conversation_cb_id);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
858 gtk_toggle_button_set_active(checkbox, accel_is_escape(&new));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
859 g_signal_handler_unblock(checkbox, escape_closes_conversation_cb_id);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
860 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
861
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
862
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
863 static void
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
864 escape_closes_conversation_cb(GtkWidget *w,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
865 gpointer unused)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
866 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
867 gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
868 gboolean changed;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
869 GtkAccelKey *new_key = active ? &escape : &ctrl_w;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
870
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
871 changed = gtk_accel_map_change_entry(CONVERSATION_CLOSE_ACCEL_PATH,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
872 new_key->accel_key, new_key->accel_mods, TRUE);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
873
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
874 /* If another path is already bound to the new accelerator,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
875 * _change_entry tries to delete that binding (because it was passed
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
876 * replace=TRUE). If that other path is locked, then _change_entry
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
877 * will fail. We don't ever lock any accelerator paths, so this case
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
878 * should never arise.
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
879 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
880 if(!changed)
22950
13152e113af9 Replace a notification that should never happen with a debug message that
Richard Laager <rlaager@pidgin.im>
parents: 22944
diff changeset
881 purple_debug_warning("gtkprefs", "Escape accel failed to change\n");
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
882 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
883
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
884
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
885 /* Creates preferences for keyboard shortcuts that it's hard to change with the
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
886 * standard Gtk accelerator-changing mechanism.
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
887 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
888 static void
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
889 keyboard_shortcuts(GtkWidget *page)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
890 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
891 GtkWidget *vbox = pidgin_make_frame(page, _("Keyboard Shortcuts"));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
892 GtkWidget *checkbox;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
893 GtkAccelKey current = { 0, 0, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
894 GtkAccelMap *map = gtk_accel_map_get();
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
895
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
896 /* Maybe it would be better just to hardcode the values?
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
897 * -- resiak, 2007-04-30
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
898 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
899 if (ctrl_w.accel_key == 0)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
900 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
901 gtk_accelerator_parse ("<Control>w", &(ctrl_w.accel_key),
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
902 &(ctrl_w.accel_mods));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
903 g_assert(ctrl_w.accel_key != 0);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
904
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
905 gtk_accelerator_parse ("Escape", &(escape.accel_key),
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
906 &(escape.accel_mods));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
907 g_assert(escape.accel_key != 0);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
908 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
909
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
910 checkbox = gtk_check_button_new_with_mnemonic(
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
911 _("Cl_ose conversations with the Escape key"));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
912 gtk_accel_map_lookup_entry(CONVERSATION_CLOSE_ACCEL_PATH, &current);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
913 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox),
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
914 accel_is_escape(&current));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
915
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
916 escape_closes_conversation_cb_id = g_signal_connect(checkbox,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
917 "clicked", G_CALLBACK(escape_closes_conversation_cb), NULL);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
918
23151
f12f7b3c0fd5 The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22984
diff changeset
919 g_signal_connect_object(map, "changed::" CONVERSATION_CLOSE_ACCEL_PATH,
f12f7b3c0fd5 The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22984
diff changeset
920 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0);
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
921
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
922 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
923 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
924
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
925 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
926 interface_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
927 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
928 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
929 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
930 GtkWidget *vbox2;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
931 GtkWidget *label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
932 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
933 GList *names = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
934
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
935 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
936 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
937
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
938 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
939
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
940 vbox = pidgin_make_frame(ret, _("System Tray Icon"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
941 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
942 PIDGIN_PREFS_ROOT "/docklet/show",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
943 _("Always"), "always",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
944 _("On unread messages"), "pending",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
945 _("Never"), "never",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
946 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
947 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
948 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
949
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
950 vbox = pidgin_make_frame(ret, _("Conversation Window Hiding"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
951 label = pidgin_prefs_dropdown(vbox, _("_Hide new IM conversations:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
952 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/im/hide_new",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
953 _("Never"), "never",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
954 _("When away"), "away",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
955 _("Always"), "always",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
956 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
957 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
958 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
959
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
960
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
961 /* All the tab options! */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
962 vbox = pidgin_make_frame(ret, _("Tabs"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
963
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
964 pidgin_prefs_checkbox(_("Show IMs and chats in _tabbed windows"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
965 PIDGIN_PREFS_ROOT "/conversations/tabs", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
966
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
967 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
968 * Connect a signal to the above preference. When conversations are not
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
969 * shown in a tabbed window then all tabbing options should be disabled.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
970 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
971 vbox2 = gtk_vbox_new(FALSE, 9);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
972 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
973 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/conversations/tabs",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
974 conversation_usetabs_cb, vbox2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
975 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
976 gtk_widget_set_sensitive(vbox2, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
977
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
978 pidgin_prefs_checkbox(_("Show close b_utton on tabs"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
979 PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", vbox2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
980
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
981 label = pidgin_prefs_dropdown(vbox2, _("_Placement:"), PURPLE_PREF_INT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
982 PIDGIN_PREFS_ROOT "/conversations/tab_side",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
983 _("Top"), GTK_POS_TOP,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
984 _("Bottom"), GTK_POS_BOTTOM,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
985 _("Left"), GTK_POS_LEFT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
986 _("Right"), GTK_POS_RIGHT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
987 #if GTK_CHECK_VERSION(2,6,0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
988 _("Left Vertical"), GTK_POS_LEFT|8,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
989 _("Right Vertical"), GTK_POS_RIGHT|8,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
990 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
991 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
992 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
993 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
994
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
995 names = pidgin_conv_placement_get_options();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
996 label = pidgin_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
997 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
998 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
999
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1000 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1001
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1002 g_list_free(names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1003
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1004
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1005 keyboard_shortcuts(ret);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1006
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1007
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1008 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1009 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1010 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1011 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1012
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1013 #if GTK_CHECK_VERSION(2,4,0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1014 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1015 pidgin_custom_font_set(GtkFontButton *font_button, gpointer nul)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1016 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1017 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1018 gtk_font_button_get_font_name(font_button));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1019 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1020 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1021
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1022 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1023 conv_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1024 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1025 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1026 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1027 GtkWidget *toolbar;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1028 GtkWidget *iconpref1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1029 GtkWidget *iconpref2;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1030 GtkWidget *fontpref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1031 GtkWidget *imhtml;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1032 GtkWidget *frame;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1033
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1034 #if GTK_CHECK_VERSION(2,4,0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1035 GtkWidget *hbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1036 GtkWidget *font_button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1037 const char *font_name;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1038 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1039
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1040 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1041 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1042
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1043 vbox = pidgin_make_frame(ret, _("Conversations"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1044
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1045 pidgin_prefs_checkbox(_("Show _formatting on incoming messages"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1046 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1047 pidgin_prefs_checkbox(_("Close IMs immediately when the tab is closed"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1048 PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1049
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1050 iconpref1 = pidgin_prefs_checkbox(_("Show _detailed information"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1051 PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1052 iconpref2 = pidgin_prefs_checkbox(_("Enable buddy ic_on animation"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1053 PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1054 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1055 gtk_widget_set_sensitive(iconpref2, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1056 g_signal_connect(G_OBJECT(iconpref1), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1057 G_CALLBACK(pidgin_toggle_sensitive), iconpref2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1058
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1059 pidgin_prefs_checkbox(_("_Notify buddies that you are typing to them"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1060 "/purple/conversations/im/send_typing", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1061 #ifdef USE_GTKSPELL
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1062 pidgin_prefs_checkbox(_("Highlight _misspelled words"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1063 PIDGIN_PREFS_ROOT "/conversations/spellcheck", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1064 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1065
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1066 pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1067
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1068 #ifdef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1069 pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1070
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1071 pidgin_prefs_checkbox(_("Minimi_ze new conversation windows"), PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1072 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1073
22974
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1074 pidgin_prefs_labeled_spin_button(vbox,
22984
0242b0a1e444 Change the label on the entry area height pref
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22974
diff changeset
1075 _("Minimum input area height in lines:"),
22974
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1076 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines",
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1077 1, 8, NULL);
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1078
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1079
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1080 #if GTK_CHECK_VERSION(2,4,0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1081 vbox = pidgin_make_frame(ret, _("Font"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1082 if (purple_running_gnome())
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1083 fontpref = pidgin_prefs_checkbox(_("Use document font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1084 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1085 fontpref = pidgin_prefs_checkbox(_("Use font from _theme"), PIDGIN_PREFS_ROOT "/conversations/use_theme_font", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1086
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1087 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1088 font_button = gtk_font_button_new_with_font(font_name ? font_name : NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1089
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1090 gtk_font_button_set_show_style(GTK_FONT_BUTTON(font_button), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1091 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Conversation _font:"), NULL, font_button, FALSE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1092 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1093 gtk_widget_set_sensitive(hbox, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1094 g_signal_connect(G_OBJECT(fontpref), "clicked", G_CALLBACK(pidgin_toggle_sensitive), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1095 g_signal_connect(G_OBJECT(font_button), "font-set", G_CALLBACK(pidgin_custom_font_set), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1096 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1097
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1098 vbox = pidgin_make_frame(ret, _("Default Formatting"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1099 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1100
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1101 frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1102 gtk_widget_show(frame);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1103 gtk_widget_set_name(imhtml, "pidgin_prefs_font_imhtml");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1104 gtk_widget_set_size_request(frame, 300, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1105 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1106 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1107 GTK_IMHTML_BOLD |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1108 GTK_IMHTML_ITALIC |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1109 GTK_IMHTML_UNDERLINE |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1110 GTK_IMHTML_GROW |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1111 GTK_IMHTML_SHRINK |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1112 GTK_IMHTML_FACE |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1113 GTK_IMHTML_FORECOLOR |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1114 GTK_IMHTML_BACKCOLOR |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1115 GTK_IMHTML_BACKGROUND);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1116
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1117 gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting."), 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1118
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1119 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1120
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1121 gtk_imhtml_setup_entry(GTK_IMHTML(imhtml), PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1122
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1123 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1124 G_CALLBACK(formatting_toggle_cb), toolbar);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1125 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1126 G_CALLBACK(formatting_clear_cb), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1127
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1128
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1129 gtk_widget_show(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1130
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1131 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1132 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1133
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1134 static void network_ip_changed(GtkEntry *entry, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1135 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1136 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1137 * TODO: It would be nice if we could validate this and show a
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1138 * red background in the box when the IP address is invalid
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1139 * and a green background when the IP address is valid.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1140 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1141 purple_network_set_public_ip(gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1142 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1143
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1144 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1145 proxy_changed_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1146 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1147 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1148 GtkWidget *frame = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1149 const char *proxy = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1150
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1151 if (strcmp(proxy, "none") && strcmp(proxy, "envvar"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1152 gtk_widget_show_all(frame);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1153 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1154 gtk_widget_hide(frame);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1155 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1156
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1157 static void proxy_print_option(GtkEntry *entry, int entrynum)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1158 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1159 if (entrynum == PROXYHOST)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1160 purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1161 else if (entrynum == PROXYPORT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1162 purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1163 else if (entrynum == PROXYUSER)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1164 purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1165 else if (entrynum == PROXYPASS)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1166 purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1167 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1168
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1169 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1170 proxy_button_clicked_cb(GtkWidget *button, gpointer null)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1171 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1172 GError *err = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1173
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1174 if (g_spawn_command_line_async ("gnome-network-preferences", &err))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1175 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1176
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1177 purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1178 g_error_free(err);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1179 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1180
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1181 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1182 browser_button_clicked_cb(GtkWidget *button, gpointer null)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1183 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1184 GError *err = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1185
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1186 if (g_spawn_command_line_async ("gnome-default-applications-properties", &err))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1187 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1188
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1189 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1190 g_error_free(err);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1191 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1192
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1193 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1194 network_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1195 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1196 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1197 GtkWidget *vbox, *hbox, *entry;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1198 GtkWidget *table, *label, *auto_ip_checkbox, *ports_checkbox, *spin_button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1199 GtkWidget *proxy_warning = NULL, *browser_warning = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1200 GtkWidget *proxy_button = NULL, *browser_button = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1201 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1202 PurpleProxyInfo *proxy_info = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1203
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1204 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1205 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1206
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1207 vbox = pidgin_make_frame (ret, _("IP Address"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1208 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1209 pidgin_prefs_labeled_entry(vbox,_("ST_UN server:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1210 "/purple/network/stun_server", sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1211
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1212 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1213 gtk_container_add(GTK_CONTAINER(vbox), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1214
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1215 label = gtk_label_new(NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1216 gtk_container_add(GTK_CONTAINER(hbox), label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1217 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1218
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1219 label = gtk_label_new(NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1220 gtk_label_set_markup(GTK_LABEL(label),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1221 _("<span style=\"italic\">Example: stunserver.org</span>"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1222 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1223 gtk_container_add(GTK_CONTAINER(hbox), label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1224
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1225 auto_ip_checkbox = pidgin_prefs_checkbox(_("_Autodetect IP address"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1226 "/purple/network/auto_ip", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1227
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1228 table = gtk_table_new(2, 2, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1229 gtk_container_set_border_width(GTK_CONTAINER(table), 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1230 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1231 gtk_table_set_row_spacings(GTK_TABLE(table), 10);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1232 gtk_container_add(GTK_CONTAINER(vbox), table);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1233
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1234 label = gtk_label_new_with_mnemonic(_("Public _IP:"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1235 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1236 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1237 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1238
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1239 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1240 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1241 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1242 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1243 G_CALLBACK(network_ip_changed), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1244
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1245 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1246 * TODO: This could be better by showing the autodeteced
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1247 * IP separately from the user-specified IP.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1248 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1249 if (purple_network_get_my_ip(-1) != NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1250 gtk_entry_set_text(GTK_ENTRY(entry),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1251 purple_network_get_my_ip(-1));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1252
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1253 pidgin_set_accessible_label (entry, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1254
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1255
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1256 if (purple_prefs_get_bool("/purple/network/auto_ip")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1257 gtk_widget_set_sensitive(GTK_WIDGET(table), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1258 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1259
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1260 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1261 G_CALLBACK(pidgin_toggle_sensitive), table);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1262
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1263 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1264
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1265 vbox = pidgin_make_frame (ret, _("Ports"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1266 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1267
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1268 pidgin_prefs_checkbox(_("_Enable automatic router port forwarding"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1269 "/purple/network/map_ports", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1270
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1271 ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1272 "/purple/network/ports_range_use", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1273
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1274 spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_Start port:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1275 "/purple/network/ports_range_start", 0, 65535, sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1276 if (!purple_prefs_get_bool("/purple/network/ports_range_use"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1277 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1278 g_signal_connect(G_OBJECT(ports_checkbox), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1279 G_CALLBACK(pidgin_toggle_sensitive), spin_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1280
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1281 spin_button = pidgin_prefs_labeled_spin_button(vbox, _("_End port:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1282 "/purple/network/ports_range_end", 0, 65535, sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1283 if (!purple_prefs_get_bool("/purple/network/ports_range_use"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1284 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1285 g_signal_connect(G_OBJECT(ports_checkbox), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1286 G_CALLBACK(pidgin_toggle_sensitive), spin_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1287
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1288 if (purple_running_gnome()) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1289 vbox = pidgin_make_frame(ret, _("Proxy Server &amp; Browser"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1290 prefs_proxy_frame = gtk_vbox_new(FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1291
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1292 proxy_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1293 gtk_container_add(GTK_CONTAINER(vbox), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1294
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1295 label = gtk_label_new(NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1296 gtk_label_set_markup(GTK_LABEL(label),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1297 _("<b>Proxy configuration program was not found.</b>"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1298 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1299
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1300 browser_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1301 gtk_container_add(GTK_CONTAINER(vbox), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1302
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1303 label = gtk_label_new(NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1304 gtk_label_set_markup(GTK_LABEL(label),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1305 _("<b>Browser configuration program was not found.</b>"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1306 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1307
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1308 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1309 gtk_container_add(GTK_CONTAINER(vbox), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1310 label = gtk_label_new(_("Proxy & Browser preferences are configured\n"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1311 "in GNOME Preferences"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1312 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1313 gtk_widget_show(label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1314
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1315 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1316 gtk_container_add(GTK_CONTAINER(vbox), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1317 proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1318 g_signal_connect(G_OBJECT(proxy_button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1319 G_CALLBACK(proxy_button_clicked_cb), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1320 gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1321 gtk_widget_show(proxy_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1322 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1323 g_signal_connect(G_OBJECT(browser_button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1324 G_CALLBACK(browser_button_clicked_cb), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1325 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1326 gtk_widget_show(browser_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1327 } else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1328 vbox = pidgin_make_frame(ret, _("Proxy Server"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1329 prefs_proxy_frame = gtk_vbox_new(FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1330
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1331 pidgin_prefs_dropdown(vbox, _("Proxy _type:"), PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1332 "/purple/proxy/type",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1333 _("No proxy"), "none",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1334 "SOCKS 4", "socks4",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1335 "SOCKS 5", "socks5",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1336 "HTTP", "http",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1337 _("Use Environmental Settings"), "envvar",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1338 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1339 gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1340 proxy_info = purple_global_proxy_get_info();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1341
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1342 purple_prefs_connect_callback(prefs, "/purple/proxy/type",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1343 proxy_changed_cb, prefs_proxy_frame);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1344
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1345 table = gtk_table_new(4, 2, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1346 gtk_container_set_border_width(GTK_CONTAINER(table), 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1347 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1348 gtk_table_set_row_spacings(GTK_TABLE(table), 10);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1349 gtk_container_add(GTK_CONTAINER(prefs_proxy_frame), table);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1350
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1351
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1352 label = gtk_label_new_with_mnemonic(_("_Host:"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1353 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1354 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1355
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1356 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1357 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1358 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1359 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1360 G_CALLBACK(proxy_print_option), (void *)PROXYHOST);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1361
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1362 if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1363 gtk_entry_set_text(GTK_ENTRY(entry),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1364 purple_proxy_info_get_host(proxy_info));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1365
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1366 hbox = gtk_hbox_new(TRUE, 5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1367 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1368 pidgin_set_accessible_label (entry, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1369
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1370 label = gtk_label_new_with_mnemonic(_("_Port:"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1371 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1372 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1373
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1374 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1375 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1376 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1377 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1378 G_CALLBACK(proxy_print_option), (void *)PROXYPORT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1379
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1380 if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1381 char buf[128];
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1382 g_snprintf(buf, sizeof(buf), "%d",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1383 purple_proxy_info_get_port(proxy_info));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1384
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1385 gtk_entry_set_text(GTK_ENTRY(entry), buf);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1386 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1387 pidgin_set_accessible_label (entry, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1388
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1389 label = gtk_label_new_with_mnemonic(_("_User:"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1390 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1391 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1392
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1393 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1394 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1395 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1396 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1397 G_CALLBACK(proxy_print_option), (void *)PROXYUSER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1398
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1399 if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1400 gtk_entry_set_text(GTK_ENTRY(entry),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1401 purple_proxy_info_get_username(proxy_info));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1402
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1403 hbox = gtk_hbox_new(TRUE, 5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1404 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1405 pidgin_set_accessible_label (entry, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1406
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1407 label = gtk_label_new_with_mnemonic(_("Pa_ssword:"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1408 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1409 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1410
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1411 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1412 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1413 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1414 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1415 if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*')
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1416 gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1417 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1418 G_CALLBACK(proxy_print_option), (void *)PROXYPASS);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1420 if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1421 gtk_entry_set_text(GTK_ENTRY(entry),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1422 purple_proxy_info_get_password(proxy_info));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1423 pidgin_set_accessible_label (entry, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1424 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1425
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1426 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1427 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1428 /* Only hide table if not running gnome otherwise we hide the IP address table! */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1429 if (!purple_running_gnome() && (proxy_info == NULL ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1430 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_NONE ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1431 purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_ENVVAR)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1432 gtk_widget_hide(table);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1433 } else if (purple_running_gnome()) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1434 gchar *path;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1435 path = g_find_program_in_path("gnome-network-preferences");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1436 if (path != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1437 gtk_widget_set_sensitive(proxy_button, TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1438 gtk_widget_hide(proxy_warning);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1439 g_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1440 } else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1441 gtk_widget_set_sensitive(proxy_button, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1442 gtk_widget_show(proxy_warning);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1443 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1444 path = g_find_program_in_path("gnome-default-applications-properties");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1445 if (path != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1446 gtk_widget_set_sensitive(browser_button, TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1447 gtk_widget_hide(browser_warning);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1448 g_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1449 } else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1450 gtk_widget_set_sensitive(browser_button, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1451 gtk_widget_show(browser_warning);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1452 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1453 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1454
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1455 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1456 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1457
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1458 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1459 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1460 const char *program = gtk_entry_get_text(GTK_ENTRY(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1461
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1462 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1463
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1464 /* carry on normally */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1465 return FALSE;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1466 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1467
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1468 static GList *get_available_browsers(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1469 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1470 struct browser {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1471 char *name;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1472 char *command;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1473 };
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1474
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1475 /* Sorted reverse alphabetically */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1476 static const struct browser possible_browsers[] = {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1477 {N_("Seamonkey"), "seamonkey"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1478 {N_("Opera"), "opera"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1479 {N_("Netscape"), "netscape"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1480 {N_("Mozilla"), "mozilla"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1481 {N_("Konqueror"), "kfmclient"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1482 {N_("Desktop Default"), "xdg-open"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1483 {N_("GNOME Default"), "gnome-open"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1484 {N_("Galeon"), "galeon"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1485 {N_("Firefox"), "firefox"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1486 {N_("Firebird"), "mozilla-firebird"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1487 {N_("Epiphany"), "epiphany"}
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1488 };
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1489 static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1490
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1491 GList *browsers = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1492 int i = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1493 char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1494
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1495 browsers = g_list_prepend(browsers, (gpointer)"custom");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1496 browsers = g_list_prepend(browsers, (gpointer)_("Manual"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1497
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1498 for (i = 0; i < num_possible_browsers; i++) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1499 if (purple_program_is_valid(possible_browsers[i].command)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1500 browsers = g_list_prepend(browsers,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1501 possible_browsers[i].command);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1502 browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1503 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1504 browser_setting = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1505 /* If xdg-open is valid, prefer it over gnome-open and skip forward */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1506 if(!strcmp(possible_browsers[i].command, "xdg-open")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1507 if (browser_setting && !strcmp("gnome-open", browser_setting)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1508 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", possible_browsers[i].command);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1509 browser_setting = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1510 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1511 i++;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1512 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1513 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1514 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1515
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1516 if(browser_setting)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1517 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1518
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1519 return browsers;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1520 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1521
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1522 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1523 browser_changed1_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1524 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1525 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1526 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1527 const char *browser = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1528
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1529 gtk_widget_set_sensitive(hbox, strcmp(browser, "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1530 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1531
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1532 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1533 browser_changed2_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1534 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1535 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1536 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1537 const char *browser = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1538
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1539 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1540 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1541
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1542 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1543 browser_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1544 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1545 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1546 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1547 GtkWidget *hbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1548 GtkWidget *label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1549 GtkWidget *entry;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1550 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1551 GList *browsers = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1552
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1553 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1554 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1555
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1556 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1557 vbox = pidgin_make_frame (ret, _("Browser Selection"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1558
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1559 browsers = get_available_browsers();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1560 if (browsers != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1561 label = pidgin_prefs_dropdown_from_list(vbox,_("_Browser:"), PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1562 PIDGIN_PREFS_ROOT "/browsers/browser",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1563 browsers);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1564 g_list_free(browsers);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1565 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1566 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1567
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1568 hbox = gtk_hbox_new(FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1569 label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), PURPLE_PREF_INT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1570 PIDGIN_PREFS_ROOT "/browsers/place",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1571 _("Browser default"), PIDGIN_BROWSER_DEFAULT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1572 _("Existing window"), PIDGIN_BROWSER_CURRENT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1573 _("New window"), PIDGIN_BROWSER_NEW_WINDOW,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1574 _("New tab"), PIDGIN_BROWSER_NEW_TAB,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1575 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1576 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1577 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1578 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1579
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1580 if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1581 gtk_widget_set_sensitive(hbox, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1582 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1583 browser_changed1_cb, hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1584 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1585
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1586 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1587 gtk_entry_set_text(GTK_ENTRY(entry),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1588 purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1589 g_signal_connect(G_OBJECT(entry), "focus-out-event",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1590 G_CALLBACK(manual_browser_set), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1591 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), sg, entry, TRUE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1592 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1593 gtk_widget_set_sensitive(hbox, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1594 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1595 browser_changed2_cb, hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1596
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1597 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1598 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1599 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1600 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1601 #endif /*_WIN32*/
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1602
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1603 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1604 logging_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1605 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1606 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1607 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1608 GList *names;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1609
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1610 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1611 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1612
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1613
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1614 vbox = pidgin_make_frame (ret, _("Logging"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1615 names = purple_log_logger_get_options();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1616
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1617 pidgin_prefs_dropdown_from_list(vbox, _("Log _format:"), PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1618 "/purple/logging/format", names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1619
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1620 g_list_free(names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1621
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1622 pidgin_prefs_checkbox(_("Log all _instant messages"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1623 "/purple/logging/log_ims", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1624 pidgin_prefs_checkbox(_("Log all c_hats"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1625 "/purple/logging/log_chats", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1626 pidgin_prefs_checkbox(_("Log all _status changes to system log"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1627 "/purple/logging/log_system", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1628
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1629 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1630
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1631 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1632 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1633
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1634 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1635 static gint sound_cmd_yeah(GtkEntry *entry, gpointer d)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1636 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1637 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1638 gtk_entry_get_text(GTK_ENTRY(entry)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1639 return TRUE;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1640 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1641
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1642 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1643 sound_changed1_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1644 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1645 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1646 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1647 const char *method = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1648
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1649 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1650 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1651
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1652 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1653 sound_changed2_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1654 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1655 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1656 GtkWidget *vbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1657 const char *method = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1658
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1659 gtk_widget_set_sensitive(vbox, strcmp(method, "none"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1660 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1661 #endif /* !_WIN32 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1662
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1663 #ifdef USE_GSTREAMER
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1664 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1665 sound_changed3_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1666 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1667 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1668 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1669 const char *method = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1670
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1671 gtk_widget_set_sensitive(hbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1672 !strcmp(method, "automatic") ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1673 !strcmp(method, "esd"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1674 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1675 #endif /* USE_GSTREAMER */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1676
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1677
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1678 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1679 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1680 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1681 GtkTreeModel *model = (GtkTreeModel *)data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1682 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1683 GtkTreePath *path = gtk_tree_path_new_from_string(pth);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1684 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1685
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1686 gtk_tree_model_get_iter (model, &iter, path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1687 gtk_tree_model_get (model, &iter,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1688 2, &pref,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1689 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1690
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1691 purple_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1692 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1693
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1694 gtk_list_store_set(GTK_LIST_STORE (model), &iter,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1695 0, !gtk_cell_renderer_toggle_get_active(cell),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1696 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1697
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1698 gtk_tree_path_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1699 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1700
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1701 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1702 test_sound(GtkWidget *button, gpointer i_am_NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1703 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1704 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1705 gboolean temp_enabled;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1706 gboolean temp_mute;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1707
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1708 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1709 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1710
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1711 temp_enabled = purple_prefs_get_bool(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1712 temp_mute = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1713
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1714 if (!temp_enabled) purple_prefs_set_bool(pref, TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1715 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1716
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1717 purple_sound_play_event(sound_row_sel, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1718
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1719 if (!temp_enabled) purple_prefs_set_bool(pref, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1720 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1721
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1722 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1723 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1724
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1725 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1726 * Resets a sound file back to default.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1727 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1728 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1729 reset_sound(GtkWidget *button, gpointer i_am_also_NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1730 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1731 gchar *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1732
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1733 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1734 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1735 purple_prefs_set_path(pref, "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1736 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1737
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1738 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1739 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1740
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1741 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1742 sound_chosen_cb(void *user_data, const char *filename)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1743 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1744 gchar *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1745 int sound;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1746
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1747 sound = GPOINTER_TO_INT(user_data);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1748
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1749 /* Set it -- and forget it */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1750 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1751 pidgin_sound_get_event_option(sound));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1752 purple_prefs_set_path(pref, filename);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1753 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1754
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1755 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1756 * If the sound we just changed is still the currently selected
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1757 * sound, then update the box showing the file name.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1758 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1759 if (sound == sound_row_sel)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1760 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1761 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1762
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1763 static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1764 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1765 gchar *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1766 const char *filename;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1767
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1768 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1769 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1770 filename = purple_prefs_get_path(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1771 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1772
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1773 if (*filename == '\0')
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1774 filename = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1775
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1776 purple_request_file(prefs, _("Sound Selection"), filename, FALSE,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1777 G_CALLBACK(sound_chosen_cb), NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1778 NULL, NULL, NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1779 GINT_TO_POINTER(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1780 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1781
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1782 #ifdef USE_GSTREAMER
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1783 static gchar* prefs_sound_volume_format(GtkScale *scale, gdouble val)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1784 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1785 if(val < 15) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1786 return g_strdup_printf(_("Quietest"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1787 } else if(val < 30) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1788 return g_strdup_printf(_("Quieter"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1789 } else if(val < 45) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1790 return g_strdup_printf(_("Quiet"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1791 } else if(val < 55) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1792 return g_strdup_printf(_("Normal"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1793 } else if(val < 70) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1794 return g_strdup_printf(_("Loud"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1795 } else if(val < 85) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1796 return g_strdup_printf(_("Louder"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1797 } else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1798 return g_strdup_printf(_("Loudest"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1799 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1800 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1801
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1802 static void prefs_sound_volume_changed(GtkRange *range)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1803 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1804 int val = (int)gtk_range_get_value(GTK_RANGE(range));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1805 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1806 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1807 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1808
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1809 static void prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1810 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1811 GValue val;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1812 const char *file;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1813 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1814
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1815 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1816 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1817
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1818 val.g_type = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1819 gtk_tree_model_get_value (model, &iter, 3, &val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1820 sound_row_sel = g_value_get_uint(&val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1821
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1822 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1823 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1824 file = purple_prefs_get_path(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1825 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1826 if (sound_entry)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1827 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1828 g_value_unset (&val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1829 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1830
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1831
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1832 static void
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1833 mute_changed_cb(const char *pref_name,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1834 PurplePrefType pref_type,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1835 gconstpointer val,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1836 gpointer data)
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1837 {
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1838 GtkToggleButton *button = data;
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1839 gboolean muted = val;
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1840
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1841 g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute"));
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1842
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1843 /* Block the handler that re-sets the preference. */
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1844 g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name);
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1845 gtk_toggle_button_set_active (button, muted);
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1846 g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, pref_name);
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1847 }
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1848
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1849
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1850 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1851 sound_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1852 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1853 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1854 GtkWidget *vbox, *sw, *button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1855 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1856 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1857 GtkWidget *event_view;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1858 GtkListStore *event_store;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1859 GtkCellRenderer *rend;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1860 GtkTreeViewColumn *col;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1861 GtkTreeSelection *sel;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1862 GtkTreePath *path;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1863 GtkWidget *hbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1864 int j;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1865 const char *file;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1866 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1867 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1868 GtkWidget *dd;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1869 GtkWidget *entry;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1870 const char *cmd;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1871 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1872
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1873 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1874 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1875
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1876 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1877
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1878 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1879 vbox = pidgin_make_frame (ret, _("Sound Method"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1880 dd = pidgin_prefs_dropdown(vbox, _("_Method:"), PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1881 PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1882 _("Console beep"), "beep",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1883 #ifdef USE_GSTREAMER
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1884 _("Automatic"), "automatic",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1885 "ESD", "esd",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1886 "ALSA", "alsa",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1887 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1888 _("Command"), "custom",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1889 _("No sounds"), "none",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1890 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1891 gtk_size_group_add_widget(sg, dd);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1892 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1893
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1894 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1895 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1896 cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1897 if(cmd)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1898 gtk_entry_set_text(GTK_ENTRY(entry), cmd);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1899 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1900 G_CALLBACK(sound_cmd_yeah), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1901
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1902 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Sound c_ommand:\n(%s for filename)"), sg, entry, TRUE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1903 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1904 sound_changed1_cb, hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1905 gtk_widget_set_sensitive(hbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1906 !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1907 "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1908 #endif /* _WIN32 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1909
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1910 vbox = pidgin_make_frame (ret, _("Sound Options"));
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1911
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1912 button = pidgin_prefs_checkbox(_("M_ute sounds"), PIDGIN_PREFS_ROOT "/sound/mute", vbox);
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1913 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/mute", mute_changed_cb, button);
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
1914
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1915 pidgin_prefs_checkbox(_("Sounds when conversation has _focus"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1916 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox);
24268
e725d9fa4cf4 Prefs/Sounds: add some mnemonics
Will Thompson <resiak@pidgin.im>
parents: 24267
diff changeset
1917 pidgin_prefs_dropdown(vbox, _("_Enable sounds:"),
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1918 PURPLE_PREF_INT, "/purple/sound/while_status",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1919 _("Only when available"), 1,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1920 _("Only when not available"), 2,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1921 _("Always"), 3,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1922 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1923
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1924 #ifdef USE_GSTREAMER
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1925 sw = gtk_hscale_new_with_range(0.0, 100.0, 5.0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1926 gtk_range_set_increments(GTK_RANGE(sw), 5.0, 25.0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1927 gtk_range_set_value(GTK_RANGE(sw), purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1928 g_signal_connect (G_OBJECT (sw), "format-value",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1929 G_CALLBACK (prefs_sound_volume_format),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1930 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1931 g_signal_connect (G_OBJECT (sw), "value-changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1932 G_CALLBACK (prefs_sound_volume_changed),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1933 NULL);
24268
e725d9fa4cf4 Prefs/Sounds: add some mnemonics
Will Thompson <resiak@pidgin.im>
parents: 24267
diff changeset
1934 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("V_olume:"), NULL, sw, TRUE, NULL);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1935
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1936 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1937 sound_changed3_cb, hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1938 sound_changed3_cb(PIDGIN_PREFS_ROOT "/sound/method", PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1939 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1940 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1941
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1942 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1943 gtk_widget_set_sensitive(vbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1944 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1945 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1946 sound_changed2_cb, vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1947 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1948
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1949 vbox = pidgin_make_frame(ret, _("Sound Events"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1950
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1951 /* The following is an ugly hack to make the frame expand so the
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1952 * sound events list is big enough to be usable */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1953 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1954 GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1955 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1956 TRUE, 0, GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1957 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1958 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1959
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1960 sw = gtk_scrolled_window_new(NULL,NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1961 gtk_widget_set_size_request(sw, -1, 100);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1962 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1963 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1964
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1965 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1966 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1967
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1968 for (j=0; j < PURPLE_NUM_SOUNDS; j++) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1969 char *pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1970 pidgin_sound_get_event_option(j));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1971 const char *label = pidgin_sound_get_event_label(j);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1972
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1973 if (label == NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1974 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1975 continue;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1976 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1977
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1978 gtk_list_store_append (event_store, &iter);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1979 gtk_list_store_set(event_store, &iter,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1980 0, purple_prefs_get_bool(pref),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1981 1, _(label),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1982 2, pref,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1983 3, j,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1984 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1985 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1986 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1987
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1988 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1989
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1990 rend = gtk_cell_renderer_toggle_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1991 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1992 g_signal_connect (G_OBJECT (sel), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1993 G_CALLBACK (prefs_sound_sel),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1994 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1995 g_signal_connect (G_OBJECT(rend), "toggled",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1996 G_CALLBACK(event_toggled), event_store);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1997 path = gtk_tree_path_new_first();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1998 gtk_tree_selection_select_path(sel, path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1999 gtk_tree_path_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2000
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2001 col = gtk_tree_view_column_new_with_attributes (_("Play"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2002 rend,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2003 "active", 0,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2004 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2005 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2006
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2007 rend = gtk_cell_renderer_text_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2008 col = gtk_tree_view_column_new_with_attributes (_("Event"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2009 rend,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2010 "text", 1,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2011 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2012 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2013 g_object_unref(G_OBJECT(event_store));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2014 gtk_container_add(GTK_CONTAINER(sw), event_view);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2015
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2016 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2017 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2018 sound_entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2019 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2020 pidgin_sound_get_event_option(0));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2021 file = purple_prefs_get_path(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2022 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2023 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2024 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2025 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2026
23261
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2027 button = gtk_button_new_with_mnemonic(_("_Browse..."));
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2028 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL);
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2029 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2030
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2031 button = gtk_button_new_with_mnemonic(_("Pre_view"));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2032 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2033 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2034
23261
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2035 button = gtk_button_new_with_mnemonic(_("_Reset"));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2036 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2037 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2038
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2039 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2040 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2041
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2042 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2043 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2044
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2045
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2046 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2047 set_idle_away(PurpleSavedStatus *status)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2048 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2049 purple_prefs_set_int("/purple/savedstatus/idleaway", purple_savedstatus_get_creation_time(status));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2050 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2051
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2052 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2053 set_startupstatus(PurpleSavedStatus *status)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2054 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2055 purple_prefs_set_int("/purple/savedstatus/startup", purple_savedstatus_get_creation_time(status));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2056 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2057
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2058 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2059 away_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2060 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2061 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2062 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2063 GtkWidget *dd;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2064 GtkWidget *label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2065 GtkWidget *button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2066 GtkWidget *select;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2067 GtkWidget *menu;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2068 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2069
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2070 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2071 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2072
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2073 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2074
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2075 /* Idle stuff */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2076 vbox = pidgin_make_frame(ret, _("Idle"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2077
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2078 dd = pidgin_prefs_dropdown(vbox, _("_Report idle time:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2079 PURPLE_PREF_STRING, "/purple/away/idle_reporting",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2080 _("Never"), "none",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2081 _("From last sent message"), "purple",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2082 #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2083 _("Based on keyboard or mouse use"), "system",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2084 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2085 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2086 gtk_size_group_add_widget(sg, dd);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2087 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2088
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2089 /* Away stuff */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2090 vbox = pidgin_make_frame(ret, _("Away"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2091
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2092 dd = pidgin_prefs_dropdown(vbox, _("_Auto-reply:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2093 PURPLE_PREF_STRING, "/purple/away/auto_reply",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2094 _("Never"), "never",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2095 _("When away"), "away",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2096 _("When both away and idle"), "awayidle",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2097 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2098 gtk_size_group_add_widget(sg, dd);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2099 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2100
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2101 /* Auto-away stuff */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2102 vbox = pidgin_make_frame(ret, _("Auto-away"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2103
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2104 button = pidgin_prefs_checkbox(_("Change status when _idle"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2105 "/purple/away/away_when_idle", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2106
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2107 select = pidgin_prefs_labeled_spin_button(vbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2108 _("_Minutes before becoming idle:"), "/purple/away/mins_before_away",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2109 1, 24 * 60, sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2110 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2111 G_CALLBACK(pidgin_toggle_sensitive), select);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2112
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2113 /* TODO: Show something useful if we don't have any saved statuses. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2114 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2115 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Change _status to:"), sg, menu, TRUE, &label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2116 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2117 G_CALLBACK(pidgin_toggle_sensitive), menu);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2118 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2119 G_CALLBACK(pidgin_toggle_sensitive), label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2120
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2121 if (!purple_prefs_get_bool("/purple/away/away_when_idle")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2122 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2123 gtk_widget_set_sensitive(GTK_WIDGET(select), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2124 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2125 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2126
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2127 /* Signon status stuff */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2128 vbox = pidgin_make_frame(ret, _("Status at Startup"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2129
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2130 button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2131 "/purple/savedstatus/startup_current_status", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2132
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2133 /* TODO: Show something useful if we don't have any saved statuses. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2134 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2135 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2136 G_CALLBACK(pidgin_toggle_sensitive), menu);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2137 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Status to a_pply at startup:"), sg, menu, TRUE, &label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2138 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2139 G_CALLBACK(pidgin_toggle_sensitive), label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2140
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2141 if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2142 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2143 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2144 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2145
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2146 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2147 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2148
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2149 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2150 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2151
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2152 static int
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2153 prefs_notebook_add_page(const char *text,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2154 GtkWidget *page,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2155 int ind) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2156
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2157 #if GTK_CHECK_VERSION(2,4,0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2158 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2159 #else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2160 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2161 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2162 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2163 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2164
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2165 static void prefs_notebook_init(void) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2166 prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2167 prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2168 prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2169 prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2170 prefs_notebook_add_page(_("Network"), network_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2171 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2172 /* We use the registered default browser in windows */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2173 /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2174 if ((purple_running_gnome() == FALSE) && (purple_running_osx() == FALSE)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2175 prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2176 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2177 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2178 prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2179 prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2180 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2181
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2182 void pidgin_prefs_show(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2183 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2184 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2185 GtkWidget *notebook;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2186 GtkWidget *button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2187
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2188 if (prefs) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2189 gtk_window_present(GTK_WINDOW(prefs));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2190 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2191 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2192
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2193 /* copy the preferences to tmp values...
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2194 * I liked "take affect immediately" Oh well :-( */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2195 /* (that should have been "effect," right?) */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2196
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2197 /* Back to instant-apply! I win! BU-HAHAHA! */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2198
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2199 /* Create the window */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2200 prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2201 g_signal_connect(G_OBJECT(prefs), "destroy",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2202 G_CALLBACK(delete_prefs), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2203
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2204 vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(prefs), FALSE, PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2205
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2206 /* The notebook */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2207 prefsnotebook = notebook = gtk_notebook_new ();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2208 gtk_box_pack_start (GTK_BOX (vbox), notebook, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2209 gtk_widget_show(prefsnotebook);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2210
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2211 button = pidgin_dialog_add_button(GTK_DIALOG(prefs), GTK_STOCK_CLOSE, NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2212 g_signal_connect_swapped(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2213 G_CALLBACK(gtk_widget_destroy), prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2214
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2215 prefs_notebook_init();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2216
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2217 /* Show everything. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2218 gtk_widget_show(prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2219 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2220
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2221 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2222 set_bool_pref(GtkWidget *w, const char *key)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2223 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2224 purple_prefs_set_bool(key,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2225 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2226 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2227
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2228 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2229 pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2230 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2231 GtkWidget *button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2232
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2233 button = gtk_check_button_new_with_mnemonic(text);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2234 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2235 purple_prefs_get_bool(key));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2236
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2237 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2238
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2239 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2240 G_CALLBACK(set_bool_pref), (char *)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2241
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2242 gtk_widget_show(button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2243
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2244 return button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2245 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2246
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2247 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2248 smiley_theme_pref_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2249 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2250 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2251 const char *themename = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2252 GSList *themes;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2253
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2254 for (themes = smiley_themes; themes; themes = themes->next) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2255 struct smiley_theme *smile = themes->data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2256 if (smile->name && strcmp(themename, smile->name) == 0) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2257 pidgin_themes_load_smiley_theme(smile->path, TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2258 break;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2259 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2260 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2261 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2262
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2263 void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2264 pidgin_prefs_init(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2265 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2266 purple_prefs_add_none(PIDGIN_PREFS_ROOT "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2267 purple_prefs_add_none("/plugins/gtk");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2268
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2269 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2270 /* Browsers */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2271 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/browsers");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2272 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2273 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/browsers/command", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2274 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2275 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2276
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2277 /* Plugins */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2278 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/plugins");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2279 purple_prefs_add_path_list(PIDGIN_PREFS_ROOT "/plugins/loaded", NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2280
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2281 /* File locations */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2282 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2283 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2284 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2285 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2286
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2287 /* Smiley Themes */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2288 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2289 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2290
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2291 /* Smiley Callbacks */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2292 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2293 smiley_theme_pref_cb, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2294
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2295 pidgin_prefs_update_old();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2296 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2297
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2298 void pidgin_prefs_update_old()
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2299 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2300 const char *str;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2301
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2302 purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2303
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2304 /* Rename some old prefs */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2305 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2306 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2307 purple_prefs_rename("/purple/conversations/placement",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2308 PIDGIN_PREFS_ROOT "/conversations/placement");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2309
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2310 purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2311 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2312
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2313 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2314 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2315
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2316 /* this string pref moved into the core, try to be friendly */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2317 purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2318 if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2319 strcmp(str, "gaim") == 0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2320 purple_prefs_set_string("/purple/away/idle_reporting", "purple");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2321
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2322 /* Remove some no-longer-used prefs */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2323 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2324 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2325 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2326 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/raise_on_events");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2327 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_group_count");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2328 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_warning_level");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2329 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/button_type");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2330 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ctrl_enter_sends");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2331 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/enter_sends");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2332 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/escape_closes");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2333 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/html_shortcuts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2334 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/icons_on_tabs");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2335 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/send_formatting");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2336 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_smileys");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2337 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_urls_as_links");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2338 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/smiley_shortcuts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2339 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_bgcolor");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2340 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_fgcolor");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2341 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2342 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_size");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2343 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/old_tab_complete");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2344 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/tab_completion");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2345 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/hide_on_send");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2346 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2347 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2348 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2349 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2350 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2351 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2352 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2353 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2354 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2355
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2356 /* Convert old queuing prefs to hide_new 3-way pref. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2357 if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2358 purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2359 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2360 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "always");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2361 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2362 else if (purple_prefs_exists(PIDGIN_PREFS_ROOT "/away/queue_messages") &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2363 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2364 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2365 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "away");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2366 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2367 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2368 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2369 purple_prefs_remove("/plugins/gtk/docklet/queue_messages");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2370
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2371 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_width");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2372 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_height");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2373 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_width");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2374 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_height");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2375 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/x",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2376 PIDGIN_PREFS_ROOT "/conversations/im/x");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2377 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/y",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2378 PIDGIN_PREFS_ROOT "/conversations/im/y");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2379 }

mercurial