annotate pidgin/gtkprefs.c @ 22778:d2af1ee7448b

Replace a notification that should never happen with a debug message that should never happen. This seems more appropriate and frees the translators from translating another string.
author Richard Laager <rlaager@wiktel.com>
date Thu, 01 May 2008 03:24:21 +0000
parents 7e28f2b64982
children 958f9379eb1a
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)
22778
d2af1ee7448b Replace a notification that should never happen with a debug message that
Richard Laager <rlaager@wiktel.com>
parents: 22772
diff changeset
881 purple_debug_warning("gtkprefs", "Escape accel failed to change\n");
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
882
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 /* 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
884 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
885 }
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 /* 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
889 * 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
890 */
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 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
892 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
893 {
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 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
895 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
896 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
897 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
898
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 /* 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
900 * -- 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
901 */
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 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
903 {
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 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
905 &(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
906 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
907
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 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
909 &(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
910 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
911 }
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 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
914 _("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
915 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
916 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
917 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
918
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 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
920 "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
921
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 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
923 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
924
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 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
926 }
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
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
928 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
929 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
930 {
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 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
932 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
933 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
934 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
935 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
936 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
937
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 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
939 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
940
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 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
942
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 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
944 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
945 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
946 _("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
947 _("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
948 _("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
949 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
950 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
951 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
952
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 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
954 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
955 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
956 _("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
957 _("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
958 _("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
959 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
960 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
961 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
962
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 /* 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
965 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
966
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 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
968 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
969
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 * 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
972 * 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
973 */
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 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
975 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
976 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
977 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
978 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
979 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
980
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 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
982 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
983
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 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
985 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
986 _("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
987 _("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
988 _("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
989 _("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
990 #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
991 _("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
992 _("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
993 #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
994 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
995 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
996 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
997
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 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
999 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
1000 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
1001 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
1002
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 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
1004
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 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
1006
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
1007
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 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
1009
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
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
1011 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
1012 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
1013 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
1014 }
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 #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
1017 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
1018 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
1019 {
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 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
1021 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
1022 }
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 #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
1024
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 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
1026 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
1027 {
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 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
1029 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
1030 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
1031 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
1032 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
1033 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
1034 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
1035 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
1036
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 #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
1038 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
1039 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
1040 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
1041 #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
1042
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 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
1044 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
1045
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 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
1047
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 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
1049 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
1050 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
1051 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
1052
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 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
1054 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
1055 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
1056 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
1057 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
1058 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
1059 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
1060 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
1061
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 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
1063 "/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
1064 #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
1065 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
1066 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
1067 #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
1068
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 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
1070
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 #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
1072 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
1073
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 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
1075 #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
1076
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 #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
1078 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
1079 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
1080 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
1081 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
1082 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
1083
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 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
1085 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
1086
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 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
1088 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
1089 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
1090 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
1091 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
1092 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
1093 #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
1094
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 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
1096 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
1097
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 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
1099 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
1100 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
1101 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
1102 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
1103 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
1104 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
1105 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
1106 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
1107 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
1108 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
1109 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
1110 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
1111 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
1112 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
1113
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 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
1115
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 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
1117
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 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
1119
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 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
1121 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
1122 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
1123 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
1124
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 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
1127
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 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
1129 }
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 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
1132 {
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 * 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
1135 * 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
1136 * 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
1137 */
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 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
1139 }
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 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
1142 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
1143 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
1144 {
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 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
1146 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
1147
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 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
1149 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
1150 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
1151 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
1152 }
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 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
1155 {
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 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
1157 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
1158 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
1159 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
1160 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
1161 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
1162 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
1163 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
1164 }
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 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
1167 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
1168 {
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 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
1170
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 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
1172 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
1173
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 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
1175 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
1176 }
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 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
1179 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
1180 {
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 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
1182
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 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
1184 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
1185
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 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
1187 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
1188 }
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 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
1191 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
1192 {
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 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
1194 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
1195 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
1196 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
1197 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
1198 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
1199 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
1200
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 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
1202 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
1203
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 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
1205 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
1206 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
1207 "/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
1208
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 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
1210 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
1211
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 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
1213 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
1214 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
1215
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 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
1217 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
1218 _("<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
1219 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
1220 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
1221
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 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
1223 "/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
1224
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 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
1226 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
1227 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
1228 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
1229 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
1230
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 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
1232 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
1233 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
1234 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
1235
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 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
1237 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
1238 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
1239 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
1240 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
1241
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 * 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
1244 * 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
1245 */
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 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
1247 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
1248 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
1249
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 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
1251
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 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
1254 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
1255 }
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 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
1258 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
1259
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 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
1261
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 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
1263 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
1264
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 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
1266 "/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
1267
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 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
1269 "/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
1270
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 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
1272 "/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
1273 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
1274 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
1275 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
1276 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
1277
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 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
1279 "/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
1280 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
1281 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
1282 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
1283 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
1284
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 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
1286 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
1287 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
1288
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 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
1290 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
1291
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 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
1293 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
1294 _("<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
1295 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
1296
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 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
1298 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
1299
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 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
1301 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
1302 _("<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
1303 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
1304
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 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
1306 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
1307 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
1308 "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
1309 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
1310 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
1311
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 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
1313 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
1314 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
1315 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
1316 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
1317 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
1318 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
1319 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
1320 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
1321 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
1322 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
1323 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
1324 } 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
1325 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
1326 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
1327
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 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
1329 "/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
1330 _("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
1331 "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
1332 "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
1333 "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
1334 _("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
1335 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
1336 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
1337 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
1338
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 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
1340 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
1341
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 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
1343 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
1344 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
1345 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
1346 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
1347
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 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
1350 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
1351 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
1352
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 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
1354 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
1355 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
1356 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
1357 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
1358
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 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
1360 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
1361 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
1362
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 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
1364 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
1365 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
1366
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 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
1368 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
1369 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
1370
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 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
1372 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
1373 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
1374 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
1375 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
1376
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 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
1378 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
1379 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
1380 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
1381
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 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
1383 }
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 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
1385
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 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
1387 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
1388 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
1389
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 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
1391 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
1392 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
1393 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
1394 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
1395
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 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
1397 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
1398 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
1399
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 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
1401 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
1402 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
1403
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 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
1405 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
1406 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
1407
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 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
1409 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
1410 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
1411 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
1412 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
1413 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
1414 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
1415 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
1416
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 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
1418 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
1419 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
1420 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
1421 }
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 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
1424 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
1425 /* 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
1426 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
1427 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
1428 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
1429 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
1430 } 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
1431 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
1432 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
1433 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
1434 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
1435 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
1436 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
1437 } 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
1438 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
1439 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
1440 }
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 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
1442 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
1443 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
1444 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
1445 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
1446 } 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
1447 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
1448 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
1449 }
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 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
1453 }
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 #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
1456 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
1457 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
1458
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 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
1460
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 /* 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
1462 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
1463 }
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 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
1466 {
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 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
1468 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
1469 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
1470 };
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 /* 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
1473 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
1474 {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
1475 {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
1476 {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
1477 {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
1478 {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
1479 {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
1480 {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
1481 {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
1482 {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
1483 {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
1484 {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
1485 };
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 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
1487
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 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
1489 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
1490 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
1491
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 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
1493 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
1494
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 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
1496 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
1497 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
1498 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
1499 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
1500 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
1501 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
1502 /* 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
1503 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
1504 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
1505 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
1506 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
1507 }
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 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
1509 }
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 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
1514 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
1515
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 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
1517 }
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 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
1520 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
1521 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
1522 {
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 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
1524 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
1525
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 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
1527 }
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 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
1530 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
1531 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
1532 {
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 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
1534 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
1535
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 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
1537 }
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 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
1540 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
1541 {
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 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
1543 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
1544 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
1545 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
1546 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
1547 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
1548 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
1549
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 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
1551 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
1552
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 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
1554 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
1555
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 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
1557 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
1558 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
1559 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
1560 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
1561 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
1562 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
1563 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
1564
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 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
1566 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
1567 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
1568 _("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
1569 _("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
1570 _("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
1571 _("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
1572 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
1573 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
1574 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
1575 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
1576
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 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
1578 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
1579 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
1580 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
1581 }
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 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
1584 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
1585 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
1586 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
1587 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
1588 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
1589 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
1590 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
1591 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
1592 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
1593
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 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
1595 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
1596 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
1597 }
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 #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
1599
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 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
1601 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
1602 {
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 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
1604 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
1605 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
1606
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 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
1608 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
1609
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 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
1612 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
1613
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 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
1615 "/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
1616
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 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
1618
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 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
1620 "/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
1621 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
1622 "/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
1623 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
1624 "/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
1625
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 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
1627
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 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
1629 }
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 #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
1632 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
1633 {
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 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
1635 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
1636 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
1637 }
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 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
1640 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
1641 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
1642 {
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 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
1644 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
1645
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 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
1647 }
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 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
1650 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
1651 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
1652 {
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 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
1654 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
1655
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 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
1657 }
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 #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
1659
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 #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
1661 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
1662 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
1663 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
1664 {
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 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
1666 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
1667
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 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
1669 !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
1670 !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
1671 }
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 #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
1673
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 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
1676 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
1677 {
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 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
1679 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
1680 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
1681 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
1682
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 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
1684 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
1685 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
1686 -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
1687
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 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
1689 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
1690
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 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
1692 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
1693 -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
1694
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 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
1696 }
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 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
1699 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
1700 {
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 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
1702 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
1703 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
1704
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 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
1706 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
1707
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 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
1709 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
1710
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 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
1712 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
1713
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 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
1715
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 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
1717 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
1718
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 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
1720 }
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 * 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
1724 */
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 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
1726 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
1727 {
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 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
1729
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 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
1731 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
1732 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
1733 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
1734
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 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
1736 }
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 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
1739 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
1740 {
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 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
1742 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
1743
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 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
1745
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 /* 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
1747 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
1748 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
1749 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
1750 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
1751
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 * 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
1754 * 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
1755 */
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 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
1757 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
1758 }
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 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
1761 {
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 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
1763 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
1764
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 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
1766 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
1767 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
1768 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
1769
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 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
1771 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
1772
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 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
1774 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
1775 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
1776 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
1777 }
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 #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
1780 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
1781 {
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 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
1783 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
1784 } 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
1785 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
1786 } 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
1787 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
1788 } 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
1789 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
1790 } 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
1791 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
1792 } 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
1793 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
1794 } 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
1795 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
1796 }
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 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
1800 {
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 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
1802 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
1803 }
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 #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
1805
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 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
1807 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
1808 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
1809 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
1810 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
1811
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 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
1813 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
1814
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 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
1816 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
1817 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
1818
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 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
1820 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
1821 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
1822 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
1823 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
1824 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
1825 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
1826 }
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 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
1829 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
1830 {
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 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
1832 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
1833 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
1834 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
1835 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
1836 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
1837 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
1838 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
1839 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
1840 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
1841 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
1842 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
1843 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
1844 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
1845 #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
1846 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
1847 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
1848 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
1849 #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
1850
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 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
1852 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
1853
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 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
1855
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 #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
1857 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
1858 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
1859 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
1860 _("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
1861 #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
1862 _("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
1863 "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
1864 "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
1865 #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
1866 _("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
1867 _("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
1868 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
1869 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
1870 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
1871
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 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
1873 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
1874 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
1875 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
1876 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
1877 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
1878 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
1879
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 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
1881 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
1882 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
1883 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
1884 !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
1885 "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
1886 #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
1887
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 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
1889 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
1890 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
1891 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
1892 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
1893 _("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
1894 _("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
1895 _("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
1896 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
1897
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 #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
1899 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
1900 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
1901 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
1902 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
1903 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
1904 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
1905 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
1906 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
1907 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
1908 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
1909
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 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
1911 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
1912 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
1913 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
1914 #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
1915
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 #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
1917 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
1918 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
1919 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
1920 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
1921 #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
1922
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 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
1924
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 /* 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
1926 * 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
1927 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
1928 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
1929 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
1930 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
1931 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
1932 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
1933
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 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
1935 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
1936 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
1937 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
1938
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 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
1940 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
1941
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 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
1943 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
1944 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
1945 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
1946
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 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
1948 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
1949 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
1950 }
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 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
1953 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
1954 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
1955 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
1956 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
1957 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
1958 -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
1959 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
1960 }
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 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
1963
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 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
1965 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
1966 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
1967 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
1968 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
1969 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
1970 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
1971 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
1972 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
1973 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
1974
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 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
1976 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
1977 "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
1978 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
1979 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
1980
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 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
1982 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
1983 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
1984 "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
1985 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
1986 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
1987 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
1988 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
1989
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 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
1991 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
1992 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
1993 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
1994 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
1995 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
1996 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
1997 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
1998 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
1999 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
2000
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 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
2002 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
2003 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
2004
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 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
2006 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
2007 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
2008
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 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
2010 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
2011 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
2012
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 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
2014 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
2015
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 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
2017 }
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 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
2021 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
2022 {
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 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
2024 }
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 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
2027 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
2028 {
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 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
2030 }
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 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
2033 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
2034 {
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 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
2036 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
2037 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
2038 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
2039 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
2040 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
2041 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
2042 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
2043
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 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
2045 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
2046
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 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
2048
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 /* 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
2050 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
2051
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 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
2053 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
2054 _("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
2055 _("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
2056 #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
2057 _("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
2058 #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
2059 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
2060 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
2061 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
2062
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 /* 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
2064 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
2065
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 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
2067 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
2068 _("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
2069 _("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
2070 _("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
2071 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
2072 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
2073 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
2074
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 /* 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
2076 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
2077
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 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
2079 "/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
2080
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 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
2082 _("_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
2083 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
2084 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
2085 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
2086
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 /* 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
2088 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
2089 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
2090 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
2091 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
2092 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
2093 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
2094
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 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
2096 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
2097 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
2098 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
2099 }
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 /* 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
2102 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
2103
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 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
2105 "/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
2106
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 /* 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
2108 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
2109 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
2110 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
2111 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
2112 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
2113 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
2114
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 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
2116 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
2117 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
2118 }
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 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
2121 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
2122
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 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
2124 }
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 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
2127 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
2128 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
2129 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
2130
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 #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
2132 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
2133 #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
2134 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
2135 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
2136 #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
2137 }
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 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
2140 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
2141 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
2142 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
2143 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
2144 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
2145 #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
2146 /* 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
2147 /* 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
2148 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
2149 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
2150 }
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 #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
2152 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
2153 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
2154 }
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 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
2157 {
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 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
2159 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
2160 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
2161
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 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
2163 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
2164 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
2165 }
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 /* 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
2168 * 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
2169 /* (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
2170
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 /* 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
2172
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 /* 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
2174 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
2175 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
2176 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
2177
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 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
2179
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 /* 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
2181 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
2182 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
2183 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
2184
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 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
2186 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
2187 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
2188
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 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
2190
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 /* 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
2192 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
2193 }
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 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
2196 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
2197 {
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 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
2199 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
2200 }
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 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
2203 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
2204 {
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 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
2206
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 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
2208 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
2209 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
2210
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 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
2212
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 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
2214 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
2215
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 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
2217
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 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
2219 }
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 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
2222 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
2223 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
2224 {
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 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
2226 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
2227
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 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
2229 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
2230 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
2231 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
2232 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
2233 }
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 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
2238 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
2239 {
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 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
2241 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
2242
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 #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
2244 /* 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
2245 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
2246 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
2247 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
2248 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
2249 #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
2250
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 /* 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
2252 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
2253 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
2254
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 /* 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
2256 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
2257 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
2258 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
2259 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
2260
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 /* 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
2262 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
2263 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
2264
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 /* 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
2266 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
2267 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
2268
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 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
2270 }
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 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
2273 {
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 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
2275
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 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
2277
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 /* 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
2279 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
2280 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
2281 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
2282 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
2283
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 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
2285 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
2286
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 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
2288 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
2289
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 /* 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
2291 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
2292 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
2293 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
2294 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
2295
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 /* 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
2297 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
2298 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
2299 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
2300 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
2301 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
2302 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
2303 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
2304 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
2305 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
2306 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
2307 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
2308 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
2309 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
2310 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
2311 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
2312 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
2313 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
2314 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
2315 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
2316 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
2317 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
2318 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
2319 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
2320 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
2321 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
2322 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
2323 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
2324 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
2325 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
2326 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
2327 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
2328 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
2329
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 /* 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
2331 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
2332 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
2333 {
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 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
2335 }
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 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
2337 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
2338 {
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 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
2340 }
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 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
2342 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
2343 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
2344
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 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
2346 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
2347 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
2348 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
2349 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
2350 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
2351 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
2352 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
2353 }