annotate pidgin/gtkprefs.c @ 22772:7e28f2b64982

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