pidgin/gtkprefs.c

Mon, 16 Nov 2009 07:04:32 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 16 Nov 2009 07:04:32 +0000
branch
cpw.rekkanoryo.prefs_window
changeset 28897
953b76a4cca7
parent 28893
48be66f3ec7f
child 28898
2c4e735113f6
permissions
-rw-r--r--

Convert Smiley theme selection to the simpler combo box affair that's in
the new prefs page.

22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1 /**
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2 * @file gtkprefs.c GTK+ Preferences
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3 * @ingroup pidgin
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
5
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
6 /* pidgin
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
7 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
8 * Pidgin is the legal property of its developers, whose names are too numerous
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
10 * source distribution.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
11 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
12 * This program is free software; you can redistribute it and/or modify
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
13 * it under the terms of the GNU General Public License as published by
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
15 * (at your option) any later version.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
16 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
17 * This program is distributed in the hope that it will be useful,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
20 * GNU General Public License for more details.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
21 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
22 * You should have received a copy of the GNU General Public License
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
23 * along with this program; if not, write to the Free Software
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
25 *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
26 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
27 #include "internal.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
28 #include "pidgin.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
29
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
30 #include "debug.h"
27522
9f8afd7cd40d In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27521
diff changeset
31 #include "nat-pmp.h"
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
32 #include "notify.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
33 #include "prefs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
34 #include "proxy.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
35 #include "prpl.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
36 #include "request.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
37 #include "savedstatuses.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
38 #include "sound.h"
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
39 #include "sound-theme.h"
27522
9f8afd7cd40d In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27521
diff changeset
40 #include "stun.h"
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
41 #include "theme-manager.h"
27522
9f8afd7cd40d In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27521
diff changeset
42 #include "upnp.h"
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
43 #include "util.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
44 #include "network.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
45
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
46 #include "gtkblist.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
47 #include "gtkconv.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
48 #include "gtkdebug.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
49 #include "gtkdialogs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
50 #include "gtkimhtml.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
51 #include "gtkimhtmltoolbar.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
52 #include "gtkprefs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
53 #include "gtksavedstatuses.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
54 #include "gtksound.h"
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
55 #include "gtkstatus-icon-theme.h"
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
56 #include "gtkthemes.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
57 #include "gtkutils.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
58 #include "pidginstock.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
59
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
60 #define PROXYHOST 0
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
61 #define PROXYPORT 1
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
62 #define PROXYUSER 2
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
63 #define PROXYPASS 3
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
64
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
65 #define PREFS_OPTIMAL_ICON_SIZE 32
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
66
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
67 struct theme_info {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
68 gchar *type;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
69 gchar *extension;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
70 gchar *original_name;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
71 };
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
72
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
73 static int sound_row_sel = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
74 static GtkWidget *prefsnotebook;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
75
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
76 static GtkWidget *sound_entry = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
77 static GtkWidget *prefs_proxy_frame = NULL;
28796
de6dabb4dd20 This feels hacky to me, so if someone has a better idea, go for it. This change
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28795
diff changeset
78 static GtkWidget *prefs_proxy_subframe = NULL;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
79
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
80 static GtkWidget *prefs = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
81 static GtkWidget *debugbutton = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
82 static int notebook_page = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
83
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
84 static GtkListStore *prefs_sound_themes;
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
85 static GtkListStore *prefs_blist_themes;
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
86 static GtkListStore *prefs_status_icon_themes;
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
87 static GtkListStore *prefs_smiley_themes;
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
88
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
89 static GtkWidget *prefs_sound_themes_combo_box;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
90 static GtkWidget *prefs_blist_themes_combo_box;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
91 static GtkWidget *prefs_status_themes_combo_box;
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
92 static GtkWidget *prefs_smiley_themes_combo_box;
23645
6901039a86fb Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23261
diff changeset
93
28482
6181f5c9a60e Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28076
diff changeset
94 static gboolean prefs_sound_themes_loading;
6181f5c9a60e Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28076
diff changeset
95
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
96 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
97 * PROTOTYPES
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
98 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
99 static void delete_prefs(GtkWidget *, void *);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
100
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
101 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
102 update_spin_value(GtkWidget *w, GtkWidget *spin)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
103 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
104 const char *key = g_object_get_data(G_OBJECT(spin), "val");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
105 int value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
106
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
107 value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
108
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
109 purple_prefs_set_int(key, value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
110 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
111
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
112 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
113 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
114 const char *key, int min, int max, GtkSizeGroup *sg)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
115 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
116 GtkWidget *spin;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
117 GtkObject *adjust;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
118 int val;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
119
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
120 val = purple_prefs_get_int(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
121
27520
a8098c44b886 Change the page_size on the GtkAdjustment used for GtkSpinButtons on the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27505
diff changeset
122 adjust = gtk_adjustment_new(val, min, max, 1, 1, 0);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
123 spin = gtk_spin_button_new(GTK_ADJUSTMENT(adjust), 1, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
124 g_object_set_data(G_OBJECT(spin), "val", (char *)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
125 if (max < 10000)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
126 gtk_widget_set_size_request(spin, 50, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
127 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
128 gtk_widget_set_size_request(spin, 60, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
129 g_signal_connect(G_OBJECT(adjust), "value-changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
130 G_CALLBACK(update_spin_value), GTK_WIDGET(spin));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
131 gtk_widget_show(spin);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
132
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
133 return pidgin_add_widget_to_vbox(GTK_BOX(box), title, sg, spin, FALSE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
134 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
135
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
136 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
137 entry_set(GtkEntry *entry, gpointer data)
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
138 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
139 const char *key = (const char*)data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
140
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
141 purple_prefs_set_string(key, gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
142 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
143
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
144 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
145 pidgin_prefs_labeled_entry(GtkWidget *page, const gchar *title,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
146 const char *key, GtkSizeGroup *sg)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
147 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
148 GtkWidget *entry;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
149 const gchar *value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
150
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
151 value = purple_prefs_get_string(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
152
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
153 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
154 gtk_entry_set_text(GTK_ENTRY(entry), value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
155 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
156 G_CALLBACK(entry_set), (char*)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
157 gtk_widget_show(entry);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
158
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
159 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
160 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
161
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
162 GtkWidget *
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
163 pidgin_prefs_labeled_password(GtkWidget *page, const gchar *title,
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
164 const char *key, GtkSizeGroup *sg)
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
165 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
166 GtkWidget *entry;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
167 const gchar *value;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
168
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
169 value = purple_prefs_get_string(key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
170
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
171 entry = gtk_entry_new();
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
172 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
173 gtk_entry_set_text(GTK_ENTRY(entry), value);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
174 g_signal_connect(G_OBJECT(entry), "changed",
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
175 G_CALLBACK(entry_set), (char*)key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
176 gtk_widget_show(entry);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
177
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
178 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
179 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
180
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
181
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
182 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
183 dropdown_set(GObject *w, const char *key)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
184 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
185 const char *str_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
186 int int_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
187 PurplePrefType type;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
188
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
189 type = GPOINTER_TO_INT(g_object_get_data(w, "type"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
190
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
191 if (type == PURPLE_PREF_INT) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
192 int_value = GPOINTER_TO_INT(g_object_get_data(w, "value"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
193
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
194 purple_prefs_set_int(key, int_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
195 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
196 else if (type == PURPLE_PREF_STRING) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
197 str_value = (const char *)g_object_get_data(w, "value");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
198
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
199 purple_prefs_set_string(key, str_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
200 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
201 else if (type == PURPLE_PREF_BOOLEAN) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
202 purple_prefs_set_bool(key,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
203 GPOINTER_TO_INT(g_object_get_data(w, "value")));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
204 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
205 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
206
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
207 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
208 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
209 PurplePrefType type, const char *key, GList *menuitems)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
210 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
211 GtkWidget *dropdown, *opt, *menu;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
212 GtkWidget *label = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
213 gchar *text;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
214 const char *stored_str = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
215 int stored_int = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
216 int int_value = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
217 const char *str_value = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
218 int o = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
219
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
220 g_return_val_if_fail(menuitems != NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
221
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
222 #if 0 /* GTK_CHECK_VERSION(2,4,0) */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
223 if(type == PURPLE_PREF_INT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
224 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
225 else if(type == PURPLE_PREF_STRING)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
226 model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
227 dropdown = gtk_combo_box_new_with_model(model);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
228 #else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
229 dropdown = gtk_option_menu_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
230 menu = gtk_menu_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
231 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
232
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
233 if (type == PURPLE_PREF_INT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
234 stored_int = purple_prefs_get_int(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
235 else if (type == PURPLE_PREF_STRING)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
236 stored_str = purple_prefs_get_string(key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
237
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
238 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
239 menuitems = g_list_next(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
240 g_return_val_if_fail(menuitems != NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
241
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
242 opt = gtk_menu_item_new_with_label(text);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
243
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
244 g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
245
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
246 if (type == PURPLE_PREF_INT) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
247 int_value = GPOINTER_TO_INT(menuitems->data);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
248 g_object_set_data(G_OBJECT(opt), "value",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
249 GINT_TO_POINTER(int_value));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
250 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
251 else if (type == PURPLE_PREF_STRING) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
252 str_value = (const char *)menuitems->data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
253
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
254 g_object_set_data(G_OBJECT(opt), "value", (char *)str_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
255 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
256 else if (type == PURPLE_PREF_BOOLEAN) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
257 g_object_set_data(G_OBJECT(opt), "value",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
258 menuitems->data);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
259 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
260
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
261 g_signal_connect(G_OBJECT(opt), "activate",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
262 G_CALLBACK(dropdown_set), (char *)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
263
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
264 gtk_widget_show(opt);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
265 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
266
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
267 if ((type == PURPLE_PREF_INT && stored_int == int_value) ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
268 (type == PURPLE_PREF_STRING && stored_str != NULL &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
269 !strcmp(stored_str, str_value)) ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
270 (type == PURPLE_PREF_BOOLEAN &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
271 (purple_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
272
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
273 gtk_menu_set_active(GTK_MENU(menu), o);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
274 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
275
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
276 menuitems = g_list_next(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
277
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
278 o++;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
279 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
280
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
281 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
282
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
283 pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
284
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
285 return label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
286 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
287
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
288 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
289 pidgin_prefs_dropdown(GtkWidget *box, const gchar *title, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
290 const char *key, ...)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
291 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
292 va_list ap;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
293 GList *menuitems = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
294 GtkWidget *dropdown = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
295 char *name;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
296 int int_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
297 const char *str_value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
298
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
299 g_return_val_if_fail(type == PURPLE_PREF_BOOLEAN || type == PURPLE_PREF_INT ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
300 type == PURPLE_PREF_STRING, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
301
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
302 va_start(ap, key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
303 while ((name = va_arg(ap, char *)) != NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
304
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
305 menuitems = g_list_prepend(menuitems, name);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
306
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
307 if (type == PURPLE_PREF_INT || type == PURPLE_PREF_BOOLEAN) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
308 int_value = va_arg(ap, int);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
309 menuitems = g_list_prepend(menuitems, GINT_TO_POINTER(int_value));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
310 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
311 else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
312 str_value = va_arg(ap, const char *);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
313 menuitems = g_list_prepend(menuitems, (char *)str_value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
314 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
315 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
316 va_end(ap);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
317
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
318 g_return_val_if_fail(menuitems != NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
319
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
320 menuitems = g_list_reverse(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
321
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
322 dropdown = pidgin_prefs_dropdown_from_list(box, title, type, key,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
323 menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
324
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
325 g_list_free(menuitems);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
326
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
327 return dropdown;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
328 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
329
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
330 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
331 delete_prefs(GtkWidget *asdf, void *gdsa)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
332 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
333 /* Close any "select sound" request dialogs */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
334 purple_request_close_with_handle(prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
335
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
336 /* Unregister callbacks. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
337 purple_prefs_disconnect_by_handle(prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
338
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
339 prefs = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
340 sound_entry = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
341 debugbutton = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
342 notebook_page = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
343 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
344
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
345 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
346 theme_refresh_theme_list(void)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
347 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
348 GdkPixbuf *pixbuf;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
349 GSList *themes;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
350 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
351
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
352 pidgin_themes_smiley_theme_probe();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
353
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
354 if (!(themes = smiley_themes))
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
355 return;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
356
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
357 while (themes) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
358 struct smiley_theme *theme = themes->data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
359 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
360 "<span size='smaller' foreground='dim grey'>%s</span>",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
361 _(theme->name), _(theme->author), _(theme->desc));
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
362 gtk_list_store_append(prefs_smiley_themes, &iter);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
363
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
364 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
365 * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
366 * looks like it should be ok to me. Anyone know what's up? --Mark
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
367 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
368 pixbuf = (theme->icon ? gdk_pixbuf_new_from_file(theme->icon, NULL) : NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
369
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
370 gtk_list_store_set(prefs_smiley_themes, &iter,
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
371 0, pixbuf,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
372 1, description,
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
373 2, theme->name,
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
374 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
375
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
376 if (pixbuf != NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
377 g_object_unref(G_OBJECT(pixbuf));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
378
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
379 g_free(description);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
380 themes = themes->next;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
381 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
382 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
383
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
384 static gchar *
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
385 get_theme_markup(const char *name, gboolean custom, const char *author,
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
386 const char *description)
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
387 {
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
388
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
389 return g_strdup_printf("<b>%s</b>%s%s%s%s\n<span foreground='dim grey'>%s</span>",
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
390 name, custom ? " " : "", custom ? _("(Custom)") : "",
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
391 author != NULL ? " - " : "", author != NULL ? author : "",
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
392 description != NULL ? description : "");
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
393 }
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
394
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
395 /* Rebuild the markup for the sound theme selection for "(Custom)" themes */
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
396 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
397 pref_sound_generate_markup(void)
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
398 {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
399 gboolean print_custom, customized;
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
400 const gchar *author, *description, *current_theme;
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
401 gchar *name, *markup;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
402 PurpleSoundTheme *theme;
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
403 GtkTreeIter iter;
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
404
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
405 customized = pidgin_sound_is_customized();
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
406 current_theme = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme");
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
407
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
408 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(prefs_sound_themes), &iter)) {
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
409 do {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
410 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &iter, 2, &name, -1);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
411
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
412 print_custom = customized && name && g_str_equal(current_theme, name);
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
413
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
414 if (!name || *name == '\0') {
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
415 g_free(name);
28875
c82190571ce8 Make the default themes' names consistent with the default smiley theme.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28874
diff changeset
416 name = g_strdup(_("Default"));
28849
5b4c00b8227f The theme authors for default/nonexistant themes should be consistent. Since
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28848
diff changeset
417 author = _("Penguin Pimps");
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
418 description = _("The default Pidgin sound theme");
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
419 } else {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
420 theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(name, "sound"));
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
421 author = purple_theme_get_author(PURPLE_THEME(theme));
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
422 description = purple_theme_get_description(PURPLE_THEME(theme));
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
423 }
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
424
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
425 markup = get_theme_markup(name, print_custom, author, description);
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
426
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
427 gtk_list_store_set(prefs_sound_themes, &iter, 1, markup, -1);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
428
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
429 g_free(name);
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
430 g_free(markup);
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
431
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
432 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(prefs_sound_themes), &iter));
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
433 }
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
434 }
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
435
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
436 /* adds the themes to the theme list from the manager so they can be displayed in prefs */
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
437 static void
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
438 prefs_themes_sort(PurpleTheme *theme)
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
439 {
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
440 GdkPixbuf *pixbuf = NULL;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
441 GtkTreeIter iter;
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
442 gchar *image_full = NULL, *markup;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
443 const gchar *name, *author, *description;
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
444
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
445 if (PURPLE_IS_SOUND_THEME(theme)){
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
446
23653
79934bf9a349 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23652
diff changeset
447 image_full = purple_theme_get_image_full(theme);
79934bf9a349 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23652
diff changeset
448 if (image_full != NULL){
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
449 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL);
23653
79934bf9a349 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23652
diff changeset
450 g_free(image_full);
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
451 } else
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
452 pixbuf = NULL;
23653
79934bf9a349 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23652
diff changeset
453
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
454 gtk_list_store_append(prefs_sound_themes, &iter);
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
455 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1);
23653
79934bf9a349 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23652
diff changeset
456
79934bf9a349 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23652
diff changeset
457 if (pixbuf != NULL)
26820
76f90ca8f6f2 Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
458 g_object_unref(G_OBJECT(pixbuf));
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
459
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
460 } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
461 GtkListStore *store;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
462
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
463 if (PIDGIN_IS_BLIST_THEME(theme))
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
464 store = prefs_blist_themes;
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
465 else
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
466 store = prefs_status_icon_themes;
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
467
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
468 image_full = purple_theme_get_image_full(theme);
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
469 if (image_full != NULL){
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
470 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL);
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
471 g_free(image_full);
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
472 } else
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
473 pixbuf = NULL;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
474
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
475 name = purple_theme_get_name(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
476 author = purple_theme_get_author(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
477 description = purple_theme_get_description(theme);
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
478
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
479 markup = get_theme_markup(name, FALSE, author, description);
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
480
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
481 gtk_list_store_append(store, &iter);
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
482 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1);
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
483
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
484 g_free(markup);
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
485 if (pixbuf != NULL)
26820
76f90ca8f6f2 Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
486 g_object_unref(G_OBJECT(pixbuf));
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
487 }
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
488 }
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
489
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
490 static void
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
491 prefs_set_active_theme_combo(GtkWidget *combo_box, GtkListStore *store, const gchar *current_theme)
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
492 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
493 GtkTreeIter iter;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
494 gchar *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
495 gboolean unset = TRUE;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
496
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
497 if (current_theme && *current_theme && gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
498 do {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
499 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 2, &theme, -1);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
500
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
501 if (g_str_equal(current_theme, theme)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
502 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_box), &iter);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
503 unset = FALSE;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
504 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
505
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
506 g_free(theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
507 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
508 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
509
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
510 if (unset)
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
511 gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
512 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
513
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
514 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
515 prefs_themes_refresh(void)
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
516 {
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
517 GdkPixbuf *pixbuf = NULL;
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
518 gchar *tmp;
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
519 GtkTreeIter iter;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
520
28482
6181f5c9a60e Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28076
diff changeset
521 prefs_sound_themes_loading = TRUE;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
522 /* refresh the list of themes in the manager */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
523 purple_theme_manager_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
524
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
525 tmp = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL);
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
526 pixbuf = gdk_pixbuf_new_from_file_at_scale(tmp, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL);
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
527 g_free(tmp);
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
528
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
529 /* sound themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
530 gtk_list_store_clear(prefs_sound_themes);
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
531 gtk_list_store_append(prefs_sound_themes, &iter);
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
532 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, "", -1);
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
533
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
534 /* blist themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
535 gtk_list_store_clear(prefs_blist_themes);
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
536 gtk_list_store_append(prefs_blist_themes, &iter);
28875
c82190571ce8 Make the default themes' names consistent with the default smiley theme.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28874
diff changeset
537 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"),
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
538 _("The default Pidgin buddy list theme"));
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
539 gtk_list_store_set(prefs_blist_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1);
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
540 g_free(tmp);
23659
8251d0f67df5 restructured much of the loader and themes for the buddy list, along with a basic trial of group background
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23653
diff changeset
541
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
542 /* status icon themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
543 gtk_list_store_clear(prefs_status_icon_themes);
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
544 gtk_list_store_append(prefs_status_icon_themes, &iter);
28875
c82190571ce8 Make the default themes' names consistent with the default smiley theme.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28874
diff changeset
545 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"),
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
546 _("The default Pidgin status icon theme"));
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
547 gtk_list_store_set(prefs_status_icon_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1);
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
548 g_free(tmp);
28741
48c271584931 Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <datallah@pidgin.im>
parents: 28627
diff changeset
549 if (pixbuf)
48c271584931 Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <datallah@pidgin.im>
parents: 28627
diff changeset
550 g_object_unref(G_OBJECT(pixbuf));
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
551
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
552 /* smiley themes */
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
553 gtk_list_store_clear(prefs_smiley_themes);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
554
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
555 purple_theme_manager_for_each_theme(prefs_themes_sort);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
556 pref_sound_generate_markup();
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
557 theme_refresh_theme_list();
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
558
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
559 /* set active */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
560 prefs_set_active_theme_combo(prefs_sound_themes_combo_box, prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"));
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
561 prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"));
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
562 prefs_set_active_theme_combo(prefs_status_themes_combo_box, prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"));
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
563 prefs_set_active_theme_combo(prefs_smiley_themes_combo_box, prefs_smiley_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme"));
28482
6181f5c9a60e Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28076
diff changeset
564 prefs_sound_themes_loading = FALSE;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
565 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
566
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
567 /* init all the theme variables so that the themes can be sorted later and used by pref pages */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
568 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
569 prefs_themes_init(void)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
570 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
571 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
572
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
573 prefs_blist_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
574
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
575 prefs_status_icon_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
576
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
577 prefs_smiley_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
578 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
579
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
580 static PurpleTheme *
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
581 prefs_theme_find_theme(const gchar *path, const gchar *type)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
582 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
583 PurpleTheme *theme = purple_theme_manager_load_theme(path, type);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
584 GDir *dir = g_dir_open(path, 0, NULL);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
585 const gchar *next;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
586
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
587 while (!PURPLE_IS_THEME(theme) && (next = g_dir_read_name(dir))) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
588 gchar *next_path = g_build_filename(path, next, NULL);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
589
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
590 if (g_file_test(next_path, G_FILE_TEST_IS_DIR))
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
591 theme = prefs_theme_find_theme(next_path, type);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
592
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
593 g_free(next_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
594 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
595
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
596 g_dir_close(dir);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
597
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
598 return theme;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
599 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
600
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
601 /* Eww. Seriously ewww. But thanks, grim! This is taken from guifications2 */
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
602 static gboolean
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
603 purple_theme_file_copy(const gchar *source, const gchar *destination)
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
604 {
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
605 FILE *src, *dest;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
606 gint chr = EOF;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
607
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
608 if(!(src = g_fopen(source, "rb")))
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
609 return FALSE;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
610 if(!(dest = g_fopen(destination, "wb"))) {
27451
6dcd55e2c594 Handle dest failing to open properly by closing the src handle.
Paul Aurich <darkrain42@pidgin.im>
parents: 27450
diff changeset
611 fclose(src);
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
612 return FALSE;
27451
6dcd55e2c594 Handle dest failing to open properly by closing the src handle.
Paul Aurich <darkrain42@pidgin.im>
parents: 27450
diff changeset
613 }
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
614
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
615 while((chr = fgetc(src)) != EOF) {
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
616 fputc(chr, dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
617 }
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
618
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
619 fclose(dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
620 fclose(src);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
621
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
622 return TRUE;
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
623 }
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
624
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
625 static void
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
626 free_theme_info(struct theme_info *info)
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
627 {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
628 if (info != NULL) {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
629 g_free(info->type);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
630 g_free(info->extension);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
631 g_free(info->original_name);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
632 g_free(info);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
633 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
634 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
635
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
636 /* installs a theme, info is freed by function */
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
637 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
638 theme_install_theme(char *path, struct theme_info *info)
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
639 {
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
640 #ifndef _WIN32
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
641 gchar *command;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
642 #endif
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
643 gchar *destdir;
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
644 const char *tail;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
645 gboolean is_smiley_theme, is_archive;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
646 PurpleTheme *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
647
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
648 if (info == NULL)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
649 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
650
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
651 /* check the extension */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
652 tail = info->extension ? info->extension : strrchr(path, '.');
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
653
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
654 if (!tail) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
655 free_theme_info(info);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
656 return;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
657 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
658
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
659 is_archive = !g_ascii_strcasecmp(tail, ".gz") || !g_ascii_strcasecmp(tail, ".tgz");
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
660
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
661 /* Just to be safe */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
662 g_strchomp(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
663
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
664 if ((is_smiley_theme = g_str_equal(info->type, "smiley")))
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
665 destdir = g_build_filename(purple_user_dir(), "smileys", NULL);
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
666 else
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
667 destdir = g_build_filename(purple_user_dir(), "themes", "temp", NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
668
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
669 /* We'll check this just to make sure. This also lets us do something different on
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
670 * other platforms, if need be */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
671 if (is_archive) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
672 #ifndef _WIN32
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
673 gchar *path_escaped = g_shell_quote(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
674 gchar *destdir_escaped = g_shell_quote(destdir);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
675
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
676 if (!g_file_test(destdir, G_FILE_TEST_IS_DIR))
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
677 purple_build_dir(destdir, S_IRUSR | S_IWUSR | S_IXUSR);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
678
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
679 command = g_strdup_printf("tar > /dev/null xzf %s -C %s", path_escaped, destdir_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
680 g_free(path_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
681 g_free(destdir_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
682
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
683 /* Fire! */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
684 if (system(command)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
685 purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
686 g_free(command);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
687 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
688 free_theme_info(info);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
689 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
690 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
691 #else
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
692 if (!winpidgin_gz_untar(path, destdir)) {
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
693 purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
694 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
695 free_theme_info(info);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
696 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
697 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
698 #endif
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
699 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
700
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
701 if (is_smiley_theme) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
702 /* just extract the folder to the smiley directory */
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
703 theme_refresh_theme_list();
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
704
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
705 prefs_themes_refresh();
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
706
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
707 } else if (is_archive) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
708 theme = prefs_theme_find_theme(destdir, info->type);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
709
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
710 if (PURPLE_IS_THEME(theme)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
711 /* create the location for the theme */
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
712 gchar *theme_dest = g_build_filename(purple_user_dir(), "themes",
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
713 purple_theme_get_name(theme),
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
714 "purple", info->type, NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
715
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
716 if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR))
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
717 purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
718
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
719 g_free(theme_dest);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
720 theme_dest = g_build_filename(purple_user_dir(), "themes",
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
721 purple_theme_get_name(theme),
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
722 "purple", info->type, NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
723
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
724 /* move the entire directory to new location */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
725 g_rename(purple_theme_get_dir(theme), theme_dest);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
726
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
727 g_free(theme_dest);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
728 g_remove(destdir);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
729 g_object_unref(theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
730
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
731 prefs_themes_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
732
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
733 } else {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
734 /* something was wrong with the theme archive */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
735 g_unlink(destdir);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
736 purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
737 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
738
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
739 } else { /* just a single file so copy it to a new temp directory and attempt to load it*/
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
740 gchar *temp_path, *temp_file;
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
741
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
742 temp_path = g_build_filename(purple_user_dir(), "themes", "temp", "sub_folder", NULL);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
743
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
744 if (info->original_name != NULL) {
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
745 /* name was changed from the original (probably a dnd) change it back before loading */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
746 temp_file = g_build_filename(temp_path, info->original_name, NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
747
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
748 } else {
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
749 gchar *source_name = g_path_get_basename(path);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
750 temp_file = g_build_filename(temp_path, source_name, NULL);
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
751 g_free(source_name);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
752 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
753
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
754 if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR))
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
755 purple_build_dir(temp_path, S_IRUSR | S_IWUSR | S_IXUSR);
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
756
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
757 if (purple_theme_file_copy(path, temp_file)) {
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
758 /* find the theme, could be in subfolder */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
759 theme = prefs_theme_find_theme(temp_path, info->type);
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
760
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
761 if (PURPLE_IS_THEME(theme)) {
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
762 gchar *theme_dest = g_build_filename(purple_user_dir(), "themes",
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
763 purple_theme_get_name(theme),
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
764 "purple", info->type, NULL);
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
765
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
766 if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR))
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
767 purple_build_dir(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
768
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
769 g_rename(purple_theme_get_dir(theme), theme_dest);
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
770
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
771 g_free(theme_dest);
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
772 g_object_unref(theme);
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
773
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
774 prefs_themes_refresh();
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
775 } else {
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
776 g_remove(temp_path);
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
777 purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL);
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
778 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
779 } else {
27450
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
780 purple_notify_error(NULL, NULL, _("Theme failed to copy."), NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
781 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
782
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
783 g_free(temp_file);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
784 g_free(temp_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
785 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
786
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
787 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
788 free_theme_info(info);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
789 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
790
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
791 static void
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
792 theme_got_url(PurpleUtilFetchUrlData *url_data, gpointer user_data,
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
793 const gchar *themedata, size_t len, const gchar *error_message)
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
794 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
795 FILE *f;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
796 gchar *path;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
797 size_t wc;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
798
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
799 if ((error_message != NULL) || (len == 0)) {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
800 free_theme_info(user_data);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
801 return;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
802 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
803
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
804 f = purple_mkstemp(&path, TRUE);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
805 wc = fwrite(themedata, len, 1, f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
806 if (wc != 1) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
807 purple_debug_warning("theme_got_url", "Unable to write theme data.\n");
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
808 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
809 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
810 g_free(path);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
811 free_theme_info(user_data);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
812 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
813 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
814 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
815
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
816 theme_install_theme(path, user_data);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
817
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
818 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
819 g_free(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
820 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
821
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
822 static void
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
823 theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y,
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
824 GtkSelectionData *sd, guint info, guint t, gpointer user_data)
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
825 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
826 gchar *name = g_strchomp((gchar *)sd->data);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
827
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
828 if ((sd->length >= 0) && (sd->format == 8)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
829 /* Well, it looks like the drag event was cool.
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
830 * Let's do something with it */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
831 gchar *temp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
832 struct theme_info *info = g_new0(struct theme_info, 1);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
833 info->type = g_strdup((gchar *)user_data);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
834 info->extension = g_strdup(g_strrstr(name,"."));
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
835 temp = g_strrstr(name, "/");
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
836 info->original_name = temp ? g_strdup(++temp) : NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
837
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
838 if (!g_ascii_strncasecmp(name, "file://", 7)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
839 GError *converr = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
840 gchar *tmp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
841 /* It looks like we're dealing with a local file. Let's
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
842 * just untar it in the right place */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
843 if(!(tmp = g_filename_from_uri(name, NULL, &converr))) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
844 purple_debug(PURPLE_DEBUG_ERROR, "theme dnd", "%s\n",
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
845 (converr ? converr->message :
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
846 "g_filename_from_uri error"));
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
847 free_theme_info(info);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
848 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
849 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
850 theme_install_theme(tmp, info);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
851 g_free(tmp);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
852 } else if (!g_ascii_strncasecmp(name, "http://", 7)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
853 /* Oo, a web drag and drop. This is where things
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
854 * will start to get interesting */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
855 purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, info);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
856 } else if (!g_ascii_strncasecmp(name, "https://", 8)) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
857 /* purple_util_fetch_url() doesn't support HTTPS, but we want users
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
858 * to be able to drag and drop links from the SF trackers, so
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
859 * we'll try it as an HTTP URL. */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
860 char *tmp = g_strdup(name + 1);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
861 tmp[0] = 'h';
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
862 tmp[1] = 't';
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
863 tmp[2] = 't';
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
864 tmp[3] = 'p';
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
865
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
866 purple_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, info);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
867 g_free(tmp);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
868 } else
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
869 free_theme_info(info);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
870
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
871 gtk_drag_finish(dc, TRUE, FALSE, t);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
872 }
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
873
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
874 gtk_drag_finish(dc, FALSE, FALSE, t);
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
875 }
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
876
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
877 /* builds a theme combo box from a list store with colums: icon preview, markup, theme name */
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
878 static GtkWidget *
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
879 prefs_build_theme_combo_box(GtkListStore *store, const char *current_theme, const char *type)
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
880 {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
881 GtkCellRenderer *cell_rend;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
882 GtkWidget *combo_box;
28483
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
883 GtkTargetEntry te[3] = {
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
884 {"text/plain", 0, 0},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
885 {"text/uri-list", 0, 1},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
886 {"STRING", 0, 2}
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
887 };
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
888
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
889 g_return_val_if_fail(store != NULL && current_theme != NULL, NULL);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
890
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
891 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
892
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
893 cell_rend = gtk_cell_renderer_pixbuf_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
894 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
895 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
896 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL);
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
897
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
898 cell_rend = gtk_cell_renderer_text_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
899 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE);
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
900 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL);
23970
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
901 /*#if GTK_CHECK_VERSION(2,6,0)
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
902 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
85dcf9218f63 fixes initialize icon theme bug by pre-loading the theme
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23967
diff changeset
903 #endif*/
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
904
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
905 gtk_drag_dest_set(combo_box, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT | GTK_DEST_DEFAULT_DROP, te,
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
906 sizeof(te) / sizeof(GtkTargetEntry) , GDK_ACTION_COPY | GDK_ACTION_MOVE);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
907
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
908 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type);
23972
90e0da03c053 theme loader cleanup, and remove a few warnings
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23970
diff changeset
909
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
910 return combo_box;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
911 }
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
912
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
913 /* sets the current sound theme */
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
914 static void
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
915 prefs_set_sound_theme_cb(GtkComboBox *combo_box, gpointer user_data)
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
916 {
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
917 gint i;
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
918 gchar *pref;
23661
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
919 gchar *new_theme;
6cfcb043b068 fixed segfault when changing blist themes, changed prefs to not rely on static iter, fixed a few leaks
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23659
diff changeset
920 GtkTreeIter new_iter;
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
921
28482
6181f5c9a60e Don't reset the sound theme pref if we're just loading the list of themes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28076
diff changeset
922 if(gtk_combo_box_get_active_iter(combo_box, &new_iter) && !prefs_sound_themes_loading) {
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
923
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
924 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &new_iter, 2, &new_theme, -1);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
925
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
926 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/sound/theme", new_theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
927
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
928 /* New theme removes all customization */
28551
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
929 for(i = 0; i < PURPLE_NUM_SOUNDS; i++){
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
930 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
931 pidgin_sound_get_event_option(i));
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
932 purple_prefs_set_path(pref, "");
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
933 g_free(pref);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
934 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
935
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
936 /* gets rid of the "(Custom)" from the last selection */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
937 pref_sound_generate_markup();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
938
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
939 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)"));
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
940
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
941 g_free(new_theme);
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
942 }
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
943 }
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
944
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
945 /* sets the current smiley theme */
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
946 static void
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
947 prefs_set_smiley_theme_cb(GtkComboBox *combo_box, gpointer user_data)
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
948 {
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
949 gchar *new_theme;
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
950 GtkTreeIter new_iter;
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
951
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
952 if (gtk_combo_box_get_active_iter(combo_box, &new_iter)) {
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
953
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
954 gtk_tree_model_get(GTK_TREE_MODEL(prefs_smiley_themes), &new_iter, 2, &new_theme, -1);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
955
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
956 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", new_theme);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
957
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
958 g_free(new_theme);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
959 }
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
960 }
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
961
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
962
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
963 /* Does same as normal sort, except "none" is sorted first */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
964 static gint pidgin_sort_smileys (GtkTreeModel *model,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
965 GtkTreeIter *a,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
966 GtkTreeIter *b,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
967 gpointer userdata)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
968 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
969 gint ret = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
970 gchar *name1 = NULL, *name2 = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
971
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
972 gtk_tree_model_get(model, a, 2, &name1, -1);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
973 gtk_tree_model_get(model, b, 2, &name2, -1);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
974
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
975 if (name1 == NULL || name2 == NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
976 if (!(name1 == NULL && name2 == NULL))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
977 ret = (name1 == NULL) ? -1: 1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
978 } else if (!g_ascii_strcasecmp(name1, "none")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
979 if (!g_utf8_collate(name1, name2))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
980 ret = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
981 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
982 /* Sort name1 first */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
983 ret = -1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
984 } else if (!g_ascii_strcasecmp(name2, "none")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
985 /* Sort name2 first */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
986 ret = 1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
987 } else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
988 /* Neither string is "none", default to normal sort */
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
989 ret = purple_utf8_strcasecmp(name1, name2);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
990 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
991
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
992 g_free(name1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
993 g_free(name2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
994
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
995 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
996 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
997
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
998 /* sets the current buddy list theme */
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
999 static void
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1000 prefs_set_blist_theme_cb(GtkComboBox *combo_box, gpointer user_data)
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1001 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1002 PidginBlistTheme *theme = NULL;
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1003 GtkTreeIter iter;
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1004 gchar *name = NULL;
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1005
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1006 if(gtk_combo_box_get_active_iter(combo_box, &iter)) {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1007
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1008 gtk_tree_model_get(GTK_TREE_MODEL(prefs_blist_themes), &iter, 2, &name, -1);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1009
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1010 if(!name || !g_str_equal(name, ""))
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1011 theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(name, "blist"));
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1012
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1013 g_free(name);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1014
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1015 pidgin_blist_set_theme(theme);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1016 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1017 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1018
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1019 /* sets the current icon theme */
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1020 static void
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1021 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data)
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1022 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1023 PidginStatusIconTheme *theme = NULL;
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1024 GtkTreeIter iter;
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1025 gchar *name = NULL;
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1026
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1027 if(gtk_combo_box_get_active_iter(combo_box, &iter)) {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1028
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1029 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1030
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1031 if(!name || !g_str_equal(name, ""))
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1032 theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon"));
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1033
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1034 g_free(name);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1035
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1036 pidgin_stock_load_status_icon_theme(theme);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1037 pidgin_blist_refresh(purple_get_blist());
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1038 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1039 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1040
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1041 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1042 theme_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1043 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1044 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1045 GtkWidget *label;
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1046 GtkWidget *themesel_hbox;
28854
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1047 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1048 GtkSizeGroup *combo_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1049
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1050 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1051 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1052
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1053 /* Instructions */
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1054 label = gtk_label_new(_("Select a theme that you would like to use from "
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1055 "the lists below. New themes can be installed by "
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1056 "dragging and dropping them onto the theme list."));
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1057
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1058 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1059 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1060 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1061
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1062 gtk_box_pack_start(GTK_BOX(ret), label, FALSE, FALSE, 0);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1063 gtk_widget_show(label);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1064
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1065 /* Buddy List Themes */
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1066 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1067
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1068 label = gtk_label_new(_("Buddy List Theme:"));
28854
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1069 gtk_size_group_add_widget(label_sg, label);
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1070 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1071
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1072 prefs_blist_themes_combo_box = prefs_build_theme_combo_box(prefs_blist_themes,
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1073 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"),
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1074 "blist");
28854
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1075 g_signal_connect(G_OBJECT(prefs_blist_themes_combo_box), "changed",
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1076 (GCallback)prefs_set_blist_theme_cb, NULL);
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1077 gtk_size_group_add_widget(combo_sg, prefs_blist_themes_combo_box);
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1078 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_blist_themes_combo_box, FALSE, FALSE, 0);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1079
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1080 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1081
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1082 /* Status Icon Themes */
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1083 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1084
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1085 label = gtk_label_new(_("Status Icon Theme:"));
28854
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1086 gtk_size_group_add_widget(label_sg, label);
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1087 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1088
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1089 prefs_status_themes_combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes,
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1090 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme"),
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1091 "icon");
28854
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1092 g_signal_connect(G_OBJECT(prefs_status_themes_combo_box), "changed",
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1093 (GCallback)prefs_set_status_icon_theme_cb, NULL);
c0d497fdc4c7 Use a couple size groups to make the buddy list and status icon theme selectors
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28853
diff changeset
1094 gtk_size_group_add_widget(combo_sg, prefs_status_themes_combo_box);
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1095 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_status_themes_combo_box, FALSE, FALSE, 0);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1096
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1097 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0);
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1098
28874
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1099 /* Sound Themes */
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1100 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1101
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1102 label = gtk_label_new(_("Sound Theme:"));
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1103 gtk_size_group_add_widget(label_sg, label);
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1104 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1105
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1106 prefs_sound_themes_combo_box = prefs_build_theme_combo_box(prefs_sound_themes,
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1107 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"),
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1108 "sound");
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1109 g_signal_connect(G_OBJECT(prefs_sound_themes_combo_box), "changed",
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1110 (GCallback)prefs_set_sound_theme_cb, NULL);
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1111 gtk_size_group_add_widget(combo_sg, prefs_sound_themes_combo_box);
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1112 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_sound_themes_combo_box, FALSE, FALSE, 0);
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1113
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1114 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0);
bd93abcfb207 Move the sound theme selector to the Themes tab and make the smiley section
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28854
diff changeset
1115
28852
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1116 /* Smiley Themes */
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1117 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1118
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1119 label = gtk_label_new(_("Smiley Theme:"));
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1120 gtk_size_group_add_widget(label_sg, label);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1121 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1122
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1123 prefs_smiley_themes_combo_box = prefs_build_theme_combo_box(prefs_smiley_themes,
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1124 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme"),
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1125 "smiley");
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1126 g_signal_connect(G_OBJECT(prefs_smiley_themes_combo_box), "changed",
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1127 (GCallback)prefs_set_smiley_theme_cb, NULL);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1128 gtk_size_group_add_widget(combo_sg, prefs_smiley_themes_combo_box);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1129 gtk_box_pack_start(GTK_BOX(themesel_hbox), prefs_smiley_themes_combo_box, FALSE, FALSE, 0);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1130
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1131 gtk_box_pack_start(GTK_BOX(ret), themesel_hbox, FALSE, FALSE, 0);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1132
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1133 /* Custom sort so "none" theme is at top of list */
28897
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1134 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(prefs_smiley_themes),
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1135 2, pidgin_sort_smileys, NULL, NULL);
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1136 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_smiley_themes),
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1137 2, GTK_SORT_ASCENDING);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1138
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1139 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1140
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1141 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1142 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1143
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1144 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1145 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1146 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1147 gboolean bold, italic, uline;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1148
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1149 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1150 &bold, &italic, &uline);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1151
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1152 if (buttons & GTK_IMHTML_BOLD)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1153 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1154 if (buttons & GTK_IMHTML_ITALIC)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1155 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1156 if (buttons & GTK_IMHTML_UNDERLINE)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1157 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1158
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1159 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1160 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1161 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1162 if (buttons & GTK_IMHTML_FACE) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1163 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1164 if (!face)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1165 face = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1166
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1167 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1168 g_free(face);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1169 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1170
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1171 if (buttons & GTK_IMHTML_FORECOLOR) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1172 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1173 if (!color)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1174 color = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1175
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1176 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1177 g_free(color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1178 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1179
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1180 if (buttons & GTK_IMHTML_BACKCOLOR) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1181 char *color;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1182 GObject *object;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1183
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1184 color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1185 if (!color)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1186 color = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1187
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1188 /* Block the signal to prevent a loop. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1189 object = g_object_ref(G_OBJECT(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1190 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1191 NULL, toolbar);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1192 /* Clear the backcolor. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1193 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1194 /* Unblock the signal. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1195 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1196 NULL, toolbar);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1197 g_object_unref(object);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1198
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1199 /* This will fire a toggle signal and get saved below. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1200 gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1201
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1202 g_free(color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1203 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1204
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1205 if (buttons & GTK_IMHTML_BACKGROUND) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1206 char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1207 if (!color)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1208 color = g_strdup("");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1209
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1210 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1211 g_free(color);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1212 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1213 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1214
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1215 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1216 formatting_clear_cb(GtkIMHtml *imhtml, void *data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1217 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1218 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1219 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1220 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1221
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1222 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1223
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1224 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1225 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1226 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1227 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1228
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1229 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1230 conversation_usetabs_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1231 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1232 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1233 gboolean usetabs = GPOINTER_TO_INT(value);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1234
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1235 if (usetabs)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1236 gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1237 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1238 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1239 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1240
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1241
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1242 #define CONVERSATION_CLOSE_ACCEL_PATH "<main>/Conversation/Close"
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1243
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1244 /* Filled in in keyboard_shortcuts(). */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1245 static GtkAccelKey ctrl_w = { 0, 0, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1246 static GtkAccelKey escape = { 0, 0, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1247
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1248 static guint escape_closes_conversation_cb_id = 0;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1249
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1250 static gboolean
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1251 accel_is_escape(GtkAccelKey *k)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1252 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1253 return (k->accel_key == escape.accel_key
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1254 && k->accel_mods == escape.accel_mods);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1255 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1256
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1257 /* Update the tickybox in Preferences when the keybinding for Conversation ->
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1258 * Close is changed via Gtk.
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1259 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1260 static void
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1261 conversation_close_accel_changed_cb (GtkAccelMap *object,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1262 gchar *accel_path,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1263 guint accel_key,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1264 GdkModifierType accel_mods,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1265 gpointer checkbox_)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1266 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1267 GtkToggleButton *checkbox = GTK_TOGGLE_BUTTON(checkbox_);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1268 GtkAccelKey new = { accel_key, accel_mods, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1269
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1270 g_signal_handler_block(checkbox, escape_closes_conversation_cb_id);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1271 gtk_toggle_button_set_active(checkbox, accel_is_escape(&new));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1272 g_signal_handler_unblock(checkbox, escape_closes_conversation_cb_id);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1273 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1274
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1275
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1276 static void
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1277 escape_closes_conversation_cb(GtkWidget *w,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1278 gpointer unused)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1279 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1280 gboolean active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1281 gboolean changed;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1282 GtkAccelKey *new_key = active ? &escape : &ctrl_w;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1283
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1284 changed = gtk_accel_map_change_entry(CONVERSATION_CLOSE_ACCEL_PATH,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1285 new_key->accel_key, new_key->accel_mods, TRUE);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1286
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1287 /* If another path is already bound to the new accelerator,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1288 * _change_entry tries to delete that binding (because it was passed
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1289 * replace=TRUE). If that other path is locked, then _change_entry
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1290 * will fail. We don't ever lock any accelerator paths, so this case
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1291 * should never arise.
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1292 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1293 if(!changed)
22950
13152e113af9 Replace a notification that should never happen with a debug message that
Richard Laager <rlaager@pidgin.im>
parents: 22944
diff changeset
1294 purple_debug_warning("gtkprefs", "Escape accel failed to change\n");
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1295 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1296
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1297
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1298 /* Creates preferences for keyboard shortcuts that it's hard to change with the
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1299 * standard Gtk accelerator-changing mechanism.
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1300 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1301 static void
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1302 keyboard_shortcuts(GtkWidget *page)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1303 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1304 GtkWidget *vbox = pidgin_make_frame(page, _("Keyboard Shortcuts"));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1305 GtkWidget *checkbox;
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1306 GtkAccelKey current = { 0, 0, 0 };
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1307 GtkAccelMap *map = gtk_accel_map_get();
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1308
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1309 /* Maybe it would be better just to hardcode the values?
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1310 * -- resiak, 2007-04-30
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1311 */
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1312 if (ctrl_w.accel_key == 0)
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1313 {
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1314 gtk_accelerator_parse ("<Control>w", &(ctrl_w.accel_key),
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1315 &(ctrl_w.accel_mods));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1316 g_assert(ctrl_w.accel_key != 0);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1317
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1318 gtk_accelerator_parse ("Escape", &(escape.accel_key),
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1319 &(escape.accel_mods));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1320 g_assert(escape.accel_key != 0);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1321 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1322
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1323 checkbox = gtk_check_button_new_with_mnemonic(
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1324 _("Cl_ose conversations with the Escape key"));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1325 gtk_accel_map_lookup_entry(CONVERSATION_CLOSE_ACCEL_PATH, &current);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1326 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox),
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1327 accel_is_escape(&current));
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1328
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1329 escape_closes_conversation_cb_id = g_signal_connect(checkbox,
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1330 "clicked", G_CALLBACK(escape_closes_conversation_cb), NULL);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1331
23151
f12f7b3c0fd5 The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22984
diff changeset
1332 g_signal_connect_object(map, "changed::" CONVERSATION_CLOSE_ACCEL_PATH,
f12f7b3c0fd5 The checkbox needs to be toggled back on only when it's alive. And the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22984
diff changeset
1333 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0);
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1334
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1335 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1336 }
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1337
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1338 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1339 interface_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1340 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1341 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1342 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1343 GtkWidget *vbox2;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1344 GtkWidget *label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1345 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1346 GList *names = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1347
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1348 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1349 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1350
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1351 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1352
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1353 /* System Tray */
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1354 vbox = pidgin_make_frame(ret, _("System Tray Icon"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1355 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1356 PIDGIN_PREFS_ROOT "/docklet/show",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1357 _("Always"), "always",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1358 _("On unread messages"), "pending",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1359 _("Never"), "never",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1360 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1361 gtk_size_group_add_widget(sg, label);
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1362 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1363
27592
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1364 vbox = pidgin_make_frame(ret, _("Conversation Window"));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1365 label = pidgin_prefs_dropdown(vbox, _("_Hide new IM conversations:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1366 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/im/hide_new",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1367 _("Never"), "never",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1368 _("When away"), "away",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1369 _("Always"), "always",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1370 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1371 gtk_size_group_add_widget(sg, label);
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1372 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1373
27592
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1374 #ifdef _WIN32
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1375 pidgin_prefs_checkbox(_("Minimi_ze new conversation windows"), PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", vbox);
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1376 #endif
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1377
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1378 /* All the tab options! */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1379 vbox = pidgin_make_frame(ret, _("Tabs"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1380
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1381 pidgin_prefs_checkbox(_("Show IMs and chats in _tabbed windows"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1382 PIDGIN_PREFS_ROOT "/conversations/tabs", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1383
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1384 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1385 * Connect a signal to the above preference. When conversations are not
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1386 * shown in a tabbed window then all tabbing options should be disabled.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1387 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1388 vbox2 = gtk_vbox_new(FALSE, 9);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1389 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1390 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/conversations/tabs",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1391 conversation_usetabs_cb, vbox2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1392 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs"))
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1393 gtk_widget_set_sensitive(vbox2, FALSE);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1394
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1395 pidgin_prefs_checkbox(_("Show close b_utton on tabs"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1396 PIDGIN_PREFS_ROOT "/conversations/close_on_tabs", vbox2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1397
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1398 label = pidgin_prefs_dropdown(vbox2, _("_Placement:"), PURPLE_PREF_INT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1399 PIDGIN_PREFS_ROOT "/conversations/tab_side",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1400 _("Top"), GTK_POS_TOP,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1401 _("Bottom"), GTK_POS_BOTTOM,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1402 _("Left"), GTK_POS_LEFT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1403 _("Right"), GTK_POS_RIGHT,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1404 #if GTK_CHECK_VERSION(2,6,0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1405 _("Left Vertical"), GTK_POS_LEFT|8,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1406 _("Right Vertical"), GTK_POS_RIGHT|8,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1407 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1408 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1409 gtk_size_group_add_widget(sg, label);
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1410 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1411
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1412 names = pidgin_conv_placement_get_options();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1413 label = pidgin_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1414 PURPLE_PREF_STRING, PIDGIN_PREFS_ROOT "/conversations/placement", names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1415 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1416
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1417 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1418
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1419 g_list_free(names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1420
22944
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1421 keyboard_shortcuts(ret);
212075e27ec1 Add a tickybox to set the 'close conversation window' shortcut to Escape.
Will Thompson <resiak@pidgin.im>
parents: 22419
diff changeset
1422
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1423 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1424 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1425 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1426 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1427
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1428 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1429 conv_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1430 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1431 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1432 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1433 GtkWidget *toolbar;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1434 GtkWidget *iconpref1;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1435 GtkWidget *iconpref2;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1436 GtkWidget *imhtml;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1437 GtkWidget *frame;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1438
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1439 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1440 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1441
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1442 vbox = pidgin_make_frame(ret, _("Conversations"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1443
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1444 pidgin_prefs_checkbox(_("Show _formatting on incoming messages"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1445 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1446 pidgin_prefs_checkbox(_("Close IMs immediately when the tab is closed"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1447 PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1448
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1449 iconpref1 = pidgin_prefs_checkbox(_("Show _detailed information"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1450 PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1451 iconpref2 = pidgin_prefs_checkbox(_("Enable buddy ic_on animation"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1452 PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1453 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1454 gtk_widget_set_sensitive(iconpref2, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1455 g_signal_connect(G_OBJECT(iconpref1), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1456 G_CALLBACK(pidgin_toggle_sensitive), iconpref2);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1457
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1458 pidgin_prefs_checkbox(_("_Notify buddies that you are typing to them"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1459 "/purple/conversations/im/send_typing", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1460 #ifdef USE_GTKSPELL
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1461 pidgin_prefs_checkbox(_("Highlight _misspelled words"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1462 PIDGIN_PREFS_ROOT "/conversations/spellcheck", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1463 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1464
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1465 pidgin_prefs_checkbox(_("Use smooth-scrolling"), PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1466
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1467 #ifdef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1468 pidgin_prefs_checkbox(_("F_lash window when IMs are received"), PIDGIN_PREFS_ROOT "/win32/blink_im", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1469 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1470
22974
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1471 pidgin_prefs_labeled_spin_button(vbox,
22984
0242b0a1e444 Change the label on the entry area height pref
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22974
diff changeset
1472 _("Minimum input area height in lines:"),
22974
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1473 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines",
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1474 1, 8, NULL);
ac33a497eaf0 Add a "minimum lines" pref for the im entry box thing; up to 8 lines.
Will Thompson <resiak@pidgin.im>
parents: 22950
diff changeset
1475
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1476 vbox = pidgin_make_frame(ret, _("Default Formatting"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1477 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1478
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1479 frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1480 gtk_widget_show(frame);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1481 gtk_widget_set_name(imhtml, "pidgin_prefs_font_imhtml");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1482 gtk_widget_set_size_request(frame, 300, -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1483 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1484 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1485 GTK_IMHTML_BOLD |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1486 GTK_IMHTML_ITALIC |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1487 GTK_IMHTML_UNDERLINE |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1488 GTK_IMHTML_GROW |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1489 GTK_IMHTML_SHRINK |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1490 GTK_IMHTML_FACE |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1491 GTK_IMHTML_FORECOLOR |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1492 GTK_IMHTML_BACKCOLOR |
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1493 GTK_IMHTML_BACKGROUND);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1494
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1495 gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting."), 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1496
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1497 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1498
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1499 gtk_imhtml_setup_entry(GTK_IMHTML(imhtml), PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1500
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1501 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1502 G_CALLBACK(formatting_toggle_cb), toolbar);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1503 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1504 G_CALLBACK(formatting_clear_cb), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1505
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1506
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1507 gtk_widget_show(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1508
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1509 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1510 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1511
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1512 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1513 network_ip_changed(GtkEntry *entry, gpointer data)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1514 {
27501
a9b9d025395b Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27493
diff changeset
1515 const gchar *text = gtk_entry_get_text(entry);
a9b9d025395b Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27493
diff changeset
1516 GdkColor color;
a9b9d025395b Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27493
diff changeset
1517
27521
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1518 if (text && *text) {
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1519 if (purple_ip_address_is_valid(text)) {
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1520 color.red = 0xAFFF;
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1521 color.green = 0xFFFF;
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1522 color.blue = 0xAFFF;
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1523
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1524 purple_network_set_public_ip(text);
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1525 } else {
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1526 color.red = 0xFFFF;
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1527 color.green = 0xAFFF;
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1528 color.blue = 0xAFFF;
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1529 }
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1530
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1531 gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, &color);
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1532
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1533 } else {
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1534 purple_network_set_public_ip("");
7ea47bf6f859 Don't colourize the IP entry field when it's empty, and reset the actual
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27520
diff changeset
1535 gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, NULL);
27501
a9b9d025395b Change the background of the IP address input in the Network preferences to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27493
diff changeset
1536 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1537 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1538
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1539 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1540 network_stun_server_changed_cb(GtkWidget *widget,
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1541 GdkEventFocus *event, gpointer data)
26256
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1542 {
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1543 GtkEntry *entry = GTK_ENTRY(widget);
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1544 purple_prefs_set_string("/purple/network/stun_server",
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1545 gtk_entry_get_text(entry));
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1546 purple_network_set_stun_server(gtk_entry_get_text(entry));
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1547
26256
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1548 return FALSE;
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1549 }
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1550
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1551 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1552 network_turn_server_changed_cb(GtkWidget *widget,
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1553 GdkEventFocus *event, gpointer data)
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1554 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1555 GtkEntry *entry = GTK_ENTRY(widget);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1556 purple_prefs_set_string("/purple/network/turn_server",
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1557 gtk_entry_get_text(entry));
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1558 purple_network_set_turn_server(gtk_entry_get_text(entry));
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1559
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1560 return FALSE;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1561 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1562
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1563 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1564 proxy_changed_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1565 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1566 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1567 GtkWidget *frame = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1568 const char *proxy = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1569
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1570 if (strcmp(proxy, "none") && strcmp(proxy, "envvar"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1571 gtk_widget_show_all(frame);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1572 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1573 gtk_widget_hide(frame);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1574 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1575
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1576 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1577 proxy_print_option(GtkEntry *entry, int entrynum)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1578 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1579 if (entrynum == PROXYHOST)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1580 purple_prefs_set_string("/purple/proxy/host", gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1581 else if (entrynum == PROXYPORT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1582 purple_prefs_set_int("/purple/proxy/port", atoi(gtk_entry_get_text(entry)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1583 else if (entrynum == PROXYUSER)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1584 purple_prefs_set_string("/purple/proxy/username", gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1585 else if (entrynum == PROXYPASS)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1586 purple_prefs_set_string("/purple/proxy/password", gtk_entry_get_text(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1587 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1588
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1589 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1590 proxy_button_clicked_cb(GtkWidget *button, gpointer null)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1591 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1592 GError *err = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1593
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1594 if (g_spawn_command_line_async ("gnome-network-preferences", &err))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1595 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1596
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1597 purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1598 g_error_free(err);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1599 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1600
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1601 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1602 browser_button_clicked_cb(GtkWidget *button, gpointer null)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1603 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1604 GError *err = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1605
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1606 if (g_spawn_command_line_async ("gnome-default-applications-properties", &err))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1607 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1608
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1609 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1610 g_error_free(err);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1611 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1612
28512
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1613 static void
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1614 auto_ip_button_clicked_cb(GtkWidget *button, gpointer null)
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1615 {
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1616 const char *ip;
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1617 PurpleStunNatDiscovery *stun;
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1618 char *auto_ip_text;
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1619
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1620 /* purple_network_get_my_ip will return the IP that was set by the user with
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1621 purple_network_set_public_ip, so make a lookup for the auto-detected IP
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1622 ourselves. */
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1623
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1624 if (purple_prefs_get_bool("/purple/network/auto_ip")) {
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1625 /* Check if STUN discovery was already done */
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1626 stun = purple_stun_discover(NULL);
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1627 if ((stun != NULL) && (stun->status == PURPLE_STUN_STATUS_DISCOVERED)) {
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1628 ip = stun->publicip;
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1629 } else {
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1630 /* Attempt to get the IP from a NAT device using UPnP */
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1631 ip = purple_upnp_get_public_ip();
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1632 if (ip == NULL) {
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1633 /* Attempt to get the IP from a NAT device using NAT-PMP */
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1634 ip = purple_pmp_get_public_ip();
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1635 if (ip == NULL) {
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1636 /* Just fetch the IP of the local system */
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1637 ip = purple_network_get_local_system_ip(-1);
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1638 }
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1639 }
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1640 }
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1641 }
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1642 else
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1643 ip = _("Disabled");
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1644
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1645 auto_ip_text = g_strdup_printf(_("Use _automatically detected IP address: %s"), ip);
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1646 gtk_button_set_label(GTK_BUTTON(button), auto_ip_text);
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1647 g_free(auto_ip_text);
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1648 }
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1649
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1650 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1651 network_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1652 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1653 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1654 GtkWidget *vbox, *hbox, *entry;
28514
10cd24370f4a Fix minor warning
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28513
diff changeset
1655 GtkWidget *label, *auto_ip_checkbox, *ports_checkbox, *spin_button;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1656 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1657
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1658 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1659 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1660
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1661 vbox = pidgin_make_frame (ret, _("IP Address"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1662 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
26256
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1663
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1664 entry = gtk_entry_new();
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1665 gtk_entry_set_text(GTK_ENTRY(entry), purple_prefs_get_string(
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1666 "/purple/network/stun_server"));
26256
d2673c935184 Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents: 26220
diff changeset
1667 g_signal_connect(G_OBJECT(entry), "focus-out-event",
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1668 G_CALLBACK(network_stun_server_changed_cb), NULL);
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1669 gtk_widget_show(entry);
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1670
28627
0bff7d254b5f Mark "STUN server:" for translation.
Paul Aurich <darkrain42@pidgin.im>
parents: 28552
diff changeset
1671 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("ST_UN server:"),
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1672 sg, entry, TRUE, NULL);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1673
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1674 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1675 gtk_container_add(GTK_CONTAINER(vbox), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1676
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1677 label = gtk_label_new(NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1678 gtk_container_add(GTK_CONTAINER(hbox), label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1679 gtk_size_group_add_widget(sg, label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1680
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1681 label = gtk_label_new(NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1682 gtk_label_set_markup(GTK_LABEL(label),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1683 _("<span style=\"italic\">Example: stunserver.org</span>"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1684 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1685 gtk_container_add(GTK_CONTAINER(hbox), label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1686
28512
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1687 auto_ip_checkbox = pidgin_prefs_checkbox("Use _automatically detected IP address",
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1688 "/purple/network/auto_ip", vbox);
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1689 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked",
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1690 G_CALLBACK(auto_ip_button_clicked_cb), NULL);
4e78d85b2375 Don't do IP discovery if the automatic IP detection pref is disabled, even
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28494
diff changeset
1691 auto_ip_button_clicked_cb(auto_ip_checkbox, NULL); /* Update label */
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1692
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1693 entry = gtk_entry_new();
28513
7dcf4884e142 I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28512
diff changeset
1694 gtk_entry_set_text(GTK_ENTRY(entry), purple_network_get_public_ip());
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1695 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1696 G_CALLBACK(network_ip_changed), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1697
28513
7dcf4884e142 I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28512
diff changeset
1698 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Public _IP:"),
7dcf4884e142 I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28512
diff changeset
1699 sg, entry, TRUE, NULL);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1700
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1701 if (purple_prefs_get_bool("/purple/network/auto_ip")) {
28513
7dcf4884e142 I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28512
diff changeset
1702 gtk_widget_set_sensitive(GTK_WIDGET(hbox), FALSE);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1703 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1704
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1705 g_signal_connect(G_OBJECT(auto_ip_checkbox), "clicked",
28513
7dcf4884e142 I don't see why the Public IP entry needs to be different and use a Table
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28512
diff changeset
1706 G_CALLBACK(pidgin_toggle_sensitive), hbox);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1707
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1708 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1709
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1710 vbox = pidgin_make_frame (ret, _("Ports"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1711 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1712
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1713 pidgin_prefs_checkbox(_("_Enable automatic router port forwarding"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1714 "/purple/network/map_ports", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1715
28794
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1716 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1717
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1718 ports_checkbox = pidgin_prefs_checkbox(_("_Manually specify range of ports to listen on:"),
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1719 "/purple/network/ports_range_use", hbox);
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1720
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1721 spin_button = pidgin_prefs_labeled_spin_button(hbox, _("_Start:"),
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1722 "/purple/network/ports_range_start", 0, 65535, sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1723 if (!purple_prefs_get_bool("/purple/network/ports_range_use"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1724 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1725 g_signal_connect(G_OBJECT(ports_checkbox), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1726 G_CALLBACK(pidgin_toggle_sensitive), spin_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1727
28794
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1728 spin_button = pidgin_prefs_labeled_spin_button(hbox, _("_End:"),
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1729 "/purple/network/ports_range_end", 0, 65535, sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1730 if (!purple_prefs_get_bool("/purple/network/ports_range_use"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1731 gtk_widget_set_sensitive(GTK_WIDGET(spin_button), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1732 g_signal_connect(G_OBJECT(ports_checkbox), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1733 G_CALLBACK(pidgin_toggle_sensitive), spin_button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1734
28794
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1735 pidgin_add_widget_to_vbox(GTK_BOX(vbox), NULL, NULL, hbox, TRUE, NULL);
42b8b3e334b5 Per discussion in devel@conference.pidgin.im a couple days ago, make the
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28741
diff changeset
1736
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1737 g_object_unref(sg);
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1738
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1739 /* TURN server */
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1740 vbox = pidgin_make_frame(ret, _("Relay Server (TURN)"));
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1741 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1742
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1743 entry = gtk_entry_new();
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1744 gtk_entry_set_text(GTK_ENTRY(entry), purple_prefs_get_string(
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1745 "/purple/network/turn_server"));
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1746 g_signal_connect(G_OBJECT(entry), "focus-out-event",
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1747 G_CALLBACK(network_turn_server_changed_cb), NULL);
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1748 gtk_widget_show(entry);
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1749
28485
83f44e0a9ccf Mark some "TURN server" strings for translation.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28483
diff changeset
1750 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_TURN server:"),
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1751 sg, entry, TRUE, NULL);
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1752
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1753 pidgin_prefs_labeled_spin_button(hbox, _("_Port:"),
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1754 "/purple/network/turn_port", 0, 65535, NULL);
28799
2ed8df75a7de Fix the accelerators on the Network tab. Have I mentioned recently that I hate
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28798
diff changeset
1755 hbox = pidgin_prefs_labeled_entry(vbox, _("Use_rname:"),
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1756 "/purple/network/turn_username", sg);
28799
2ed8df75a7de Fix the accelerators on the Network tab. Have I mentioned recently that I hate
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28798
diff changeset
1757 pidgin_prefs_labeled_password(hbox, _("Pass_word:"),
26336
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1758 "/purple/network/turn_password", NULL);
46202497d8c3 Fix up the network preference window.
Michael Ruprecht <maiku@pidgin.im>
parents: 26319
diff changeset
1759
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1760 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1761 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1762
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1763 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1764 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1765
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1766 #ifndef _WIN32
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1767 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1768 manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data)
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1769 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1770 const char *program = gtk_entry_get_text(GTK_ENTRY(entry));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1771
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1772 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/browsers/command", program);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1773
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1774 /* carry on normally */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1775 return FALSE;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1776 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1777
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1778 static GList *
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1779 get_available_browsers(void)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1780 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1781 struct browser {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1782 char *name;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1783 char *command;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1784 };
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1785
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1786 /* Sorted reverse alphabetically */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1787 static const struct browser possible_browsers[] = {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1788 {N_("Seamonkey"), "seamonkey"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1789 {N_("Opera"), "opera"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1790 {N_("Netscape"), "netscape"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1791 {N_("Mozilla"), "mozilla"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1792 {N_("Konqueror"), "kfmclient"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1793 {N_("Desktop Default"), "xdg-open"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1794 {N_("GNOME Default"), "gnome-open"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1795 {N_("Galeon"), "galeon"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1796 {N_("Firefox"), "firefox"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1797 {N_("Firebird"), "mozilla-firebird"},
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1798 {N_("Epiphany"), "epiphany"}
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1799 };
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1800 static const int num_possible_browsers = G_N_ELEMENTS(possible_browsers);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1801
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1802 GList *browsers = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1803 int i = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1804 char *browser_setting = (char *)purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1805
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1806 browsers = g_list_prepend(browsers, (gpointer)"custom");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1807 browsers = g_list_prepend(browsers, (gpointer)_("Manual"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1808
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1809 for (i = 0; i < num_possible_browsers; i++) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1810 if (purple_program_is_valid(possible_browsers[i].command)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1811 browsers = g_list_prepend(browsers,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1812 possible_browsers[i].command);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1813 browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1814 if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1815 browser_setting = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1816 /* If xdg-open is valid, prefer it over gnome-open and skip forward */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1817 if(!strcmp(possible_browsers[i].command, "xdg-open")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1818 if (browser_setting && !strcmp("gnome-open", browser_setting)) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1819 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", possible_browsers[i].command);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1820 browser_setting = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1821 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1822 i++;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1823 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1824 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1825 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1826
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1827 if(browser_setting)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1828 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "custom");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1829
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1830 return browsers;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1831 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1832
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1833 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1834 browser_changed1_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1835 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1836 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1837 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1838 const char *browser = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1839
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1840 gtk_widget_set_sensitive(hbox, strcmp(browser, "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1841 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1842
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1843 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1844 browser_changed2_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1845 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1846 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1847 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1848 const char *browser = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1849
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1850 gtk_widget_set_sensitive(hbox, !strcmp(browser, "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1851 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1852
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1853 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1854 browser_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1855 {
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1856 GtkWidget *ret, *vbox, *hbox, *label, *entry;
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1857 GtkWidget *browser_warning, *browser_button;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1858 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1859 GList *browsers = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1860
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1861 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1862 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1863
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1864 vbox = pidgin_make_frame (ret, _("Browser Selection"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1865
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1866 if(purple_running_gnome()) {
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1867 browser_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1868 gtk_container_add(GTK_CONTAINER(vbox), hbox);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1869
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1870 label = gtk_label_new(NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1871 gtk_label_set_markup(GTK_LABEL(label),
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1872 _("<b>Browser configuration program was not found.</b>"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1873 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1874
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1875 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1876 gtk_container_add(GTK_CONTAINER(vbox), hbox);
28893
48be66f3ec7f Missed some widgets in that last one.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28892
diff changeset
1877 gtk_widget_show(hbox);
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1878
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1879 label = gtk_label_new(_("Browser preferences are configured in GNOME preferences"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1880 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1881 gtk_widget_show(label);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1882
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1883 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1884 gtk_container_add(GTK_CONTAINER(vbox), hbox);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1885 browser_button = gtk_button_new_with_mnemonic(_("Configure _Browser"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1886 g_signal_connect(G_OBJECT(browser_button), "clicked",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1887 G_CALLBACK(browser_button_clicked_cb), NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1888 gtk_box_pack_start(GTK_BOX(hbox), browser_button, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1889 gtk_widget_show(browser_button);
28893
48be66f3ec7f Missed some widgets in that last one.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28892
diff changeset
1890 gtk_widget_show(hbox);
28892
7c524ef202b2 This should fix QuLogic's missing tabs, I hope.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28891
diff changeset
1891
7c524ef202b2 This should fix QuLogic's missing tabs, I hope.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28891
diff changeset
1892 gtk_widget_show(vbox);
7c524ef202b2 This should fix QuLogic's missing tabs, I hope.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28891
diff changeset
1893 gtk_widget_show(ret);
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1894 } else {
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1895 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1896
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1897 browsers = get_available_browsers();
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1898 if (browsers != NULL) {
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1899 label = pidgin_prefs_dropdown_from_list(vbox,_("_Browser:"), PURPLE_PREF_STRING,
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1900 PIDGIN_PREFS_ROOT "/browsers/browser",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1901 browsers);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1902 g_list_free(browsers);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1903 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1904 gtk_size_group_add_widget(sg, label);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1905
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1906 hbox = gtk_hbox_new(FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1907 label = pidgin_prefs_dropdown(hbox, _("_Open link in:"), PURPLE_PREF_INT,
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1908 PIDGIN_PREFS_ROOT "/browsers/place",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1909 _("Browser default"), PIDGIN_BROWSER_DEFAULT,
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1910 _("Existing window"), PIDGIN_BROWSER_CURRENT,
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1911 _("New window"), PIDGIN_BROWSER_NEW_WINDOW,
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1912 _("New tab"), PIDGIN_BROWSER_NEW_TAB,
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1913 NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1914 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1915 gtk_size_group_add_widget(sg, label);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1916 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1917
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1918 if (!strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom"))
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1919 gtk_widget_set_sensitive(hbox, FALSE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1920 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1921 browser_changed1_cb, hbox);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1922 }
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1923
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1924 entry = gtk_entry_new();
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1925 gtk_entry_set_text(GTK_ENTRY(entry),
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1926 purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1927 g_signal_connect(G_OBJECT(entry), "focus-out-event",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1928 G_CALLBACK(manual_browser_set), NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1929 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("_Manual:\n(%s for URL)"), sg, entry, TRUE, NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1930 if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"), "custom"))
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1931 gtk_widget_set_sensitive(hbox, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1932 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/browsers/browser",
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1933 browser_changed2_cb, hbox);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1934
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1935 gtk_widget_show_all(ret);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1936 g_object_unref(sg);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1937 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1938
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1939 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1940 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1941 #endif /*_WIN32*/
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1942
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1943 static GtkWidget *
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1944 proxy_page(void)
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1945 {
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1946 GtkWidget *ret = NULL, *vbox = NULL, *hbox = NULL;
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1947 GtkWidget *table = NULL, *entry = NULL, *label = NULL;
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1948 GtkWidget *proxy_warning = NULL, *proxy_button = NULL;
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1949 PurpleProxyInfo *proxy_info;
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1950
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1951 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
28853
7f8852f3da5e I forgot to set the border on the proxy tab. This looks much better now.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28852
diff changeset
1952 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1953 vbox = pidgin_make_frame(ret, _("Proxy Server"));
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1954 prefs_proxy_frame = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1955
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1956 if(purple_running_gnome()) {
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1957 proxy_warning = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1958 gtk_container_add(GTK_CONTAINER(vbox), hbox);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1959
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1960 label = gtk_label_new(NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1961 gtk_label_set_markup(GTK_LABEL(label),
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1962 _("<b>Proxy configuration program was not found.</b>"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1963 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1964
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1965 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1966 gtk_container_add(GTK_CONTAINER(vbox), hbox);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1967
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1968 label = gtk_label_new(_("Proxy preferences are configured in GNOME preferences"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1969 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1970 gtk_widget_show(label);
28893
48be66f3ec7f Missed some widgets in that last one.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28892
diff changeset
1971 gtk_widget_show(hbox);
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1972
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1973 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1974 gtk_container_add(GTK_CONTAINER(vbox), hbox);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1975 proxy_button = gtk_button_new_with_mnemonic(_("Configure _Proxy"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1976 g_signal_connect(G_OBJECT(proxy_button), "clicked",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1977 G_CALLBACK(proxy_button_clicked_cb), NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1978 gtk_box_pack_start(GTK_BOX(hbox), proxy_button, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1979 gtk_widget_show(proxy_button);
28893
48be66f3ec7f Missed some widgets in that last one.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28892
diff changeset
1980 gtk_widget_show(hbox);
28892
7c524ef202b2 This should fix QuLogic's missing tabs, I hope.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28891
diff changeset
1981
7c524ef202b2 This should fix QuLogic's missing tabs, I hope.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28891
diff changeset
1982 gtk_widget_show(vbox);
7c524ef202b2 This should fix QuLogic's missing tabs, I hope.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28891
diff changeset
1983 gtk_widget_show(ret);
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1984 } else {
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1985 prefs_proxy_subframe = gtk_vbox_new(FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1986
28891
6502040769d4 Silence some assertions QuLogic noticed.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28890
diff changeset
1987 /* This is a global option that affects SOCKS4 usage even with
6502040769d4 Silence some assertions QuLogic noticed.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28890
diff changeset
1988 * account-specific proxy settings */
28887
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1989 pidgin_prefs_checkbox(_("Use remote _DNS with SOCKS4 proxies"),
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1990 "/purple/proxy/socks4_remotedns", prefs_proxy_frame);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1991 gtk_box_pack_start(GTK_BOX(vbox), prefs_proxy_frame, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1992
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1993 pidgin_prefs_dropdown(prefs_proxy_frame, _("Proxy t_ype:"), PURPLE_PREF_STRING,
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1994 "/purple/proxy/type",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1995 _("No proxy"), "none",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1996 "SOCKS 4", "socks4",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1997 "SOCKS 5", "socks5",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1998 "HTTP", "http",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
1999 _("Use Environmental Settings"), "envvar",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2000 NULL);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2001 gtk_box_pack_start(GTK_BOX(prefs_proxy_frame), prefs_proxy_subframe, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2002 proxy_info = purple_global_proxy_get_info();
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2003
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2004 gtk_widget_show_all(ret);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2005
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2006 purple_prefs_connect_callback(prefs, "/purple/proxy/type",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2007 proxy_changed_cb, prefs_proxy_subframe);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2008
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2009 table = gtk_table_new(4, 2, FALSE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2010 gtk_container_set_border_width(GTK_CONTAINER(table), 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2011 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2012 gtk_table_set_row_spacings(GTK_TABLE(table), 10);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2013 gtk_container_add(GTK_CONTAINER(prefs_proxy_subframe), table);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2014
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2015
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2016 label = gtk_label_new_with_mnemonic(_("_Host:"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2017 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2018 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2019
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2020 entry = gtk_entry_new();
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2021 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2022 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2023 g_signal_connect(G_OBJECT(entry), "changed",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2024 G_CALLBACK(proxy_print_option), (void *)PROXYHOST);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2025
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2026 if (proxy_info != NULL && purple_proxy_info_get_host(proxy_info))
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2027 gtk_entry_set_text(GTK_ENTRY(entry),
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2028 purple_proxy_info_get_host(proxy_info));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2029
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2030 hbox = gtk_hbox_new(TRUE, 5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2031 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2032 pidgin_set_accessible_label (entry, label);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2033
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2034 label = gtk_label_new_with_mnemonic(_("P_ort:"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2035 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2036 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_FILL, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2037
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2038 entry = gtk_spin_button_new_with_range(0, 65535, 1);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2039 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2040 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 0, 1, GTK_FILL, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2041 g_signal_connect(G_OBJECT(entry), "changed",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2042 G_CALLBACK(proxy_print_option), (void *)PROXYPORT);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2043
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2044 if (proxy_info != NULL && purple_proxy_info_get_port(proxy_info) != 0) {
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2045 char buf[128];
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2046 g_snprintf(buf, sizeof(buf), "%d",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2047 purple_proxy_info_get_port(proxy_info));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2048
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2049 gtk_entry_set_text(GTK_ENTRY(entry), buf);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2050 }
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2051 pidgin_set_accessible_label (entry, label);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2052
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2053 label = gtk_label_new_with_mnemonic(_("User_name:"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2054 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2055 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2056
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2057 entry = gtk_entry_new();
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2058 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2059 gtk_table_attach(GTK_TABLE(table), entry, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2060 g_signal_connect(G_OBJECT(entry), "changed",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2061 G_CALLBACK(proxy_print_option), (void *)PROXYUSER);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2062
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2063 if (proxy_info != NULL && purple_proxy_info_get_username(proxy_info) != NULL)
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2064 gtk_entry_set_text(GTK_ENTRY(entry),
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2065 purple_proxy_info_get_username(proxy_info));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2066
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2067 hbox = gtk_hbox_new(TRUE, 5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2068 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2069 pidgin_set_accessible_label (entry, label);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2070
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2071 label = gtk_label_new_with_mnemonic(_("Pa_ssword:"));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2072 gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2073 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 1, 2, GTK_FILL, 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2074
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2075 entry = gtk_entry_new();
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2076 gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2077 gtk_table_attach(GTK_TABLE(table), entry, 3, 4, 1, 2, GTK_FILL , 0, 0, 0);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2078 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2079 #if !GTK_CHECK_VERSION(2,16,0)
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2080 if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*')
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2081 gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2082 #endif /* Less than GTK+ 2.16 */
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2083 g_signal_connect(G_OBJECT(entry), "changed",
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2084 G_CALLBACK(proxy_print_option), (void *)PROXYPASS);
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2085
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2086 if (proxy_info != NULL && purple_proxy_info_get_password(proxy_info) != NULL)
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2087 gtk_entry_set_text(GTK_ENTRY(entry),
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2088 purple_proxy_info_get_password(proxy_info));
0255b0a69452 Relocate the proxy and browser blurbs for GNOME users to the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28878
diff changeset
2089 pidgin_set_accessible_label (entry, label);
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2090 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2091
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2092 return ret;
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2093 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2094
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2095 static GtkWidget *
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2096 logging_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2097 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2098 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2099 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2100 GList *names;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2101
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2102 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2103 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2104
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2105
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2106 vbox = pidgin_make_frame (ret, _("Logging"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2107 names = purple_log_logger_get_options();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2108
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2109 pidgin_prefs_dropdown_from_list(vbox, _("Log _format:"), PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2110 "/purple/logging/format", names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2111
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2112 g_list_free(names);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2113
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2114 pidgin_prefs_checkbox(_("Log all _instant messages"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2115 "/purple/logging/log_ims", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2116 pidgin_prefs_checkbox(_("Log all c_hats"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2117 "/purple/logging/log_chats", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2118 pidgin_prefs_checkbox(_("Log all _status changes to system log"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2119 "/purple/logging/log_system", vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2120
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2121 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2122
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2123 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2124 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2125
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2126 #ifndef _WIN32
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2127 static gint
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2128 sound_cmd_yeah(GtkEntry *entry, gpointer d)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2129 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2130 purple_prefs_set_path(PIDGIN_PREFS_ROOT "/sound/command",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2131 gtk_entry_get_text(GTK_ENTRY(entry)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2132 return TRUE;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2133 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2134
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2135 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2136 sound_changed1_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2137 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2138 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2139 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2140 const char *method = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2141
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2142 gtk_widget_set_sensitive(hbox, !strcmp(method, "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2143 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2144
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2145 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2146 sound_changed2_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2147 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2148 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2149 GtkWidget *vbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2150 const char *method = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2151
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2152 gtk_widget_set_sensitive(vbox, strcmp(method, "none"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2153 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2154 #endif /* !_WIN32 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2155
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2156 #ifdef USE_GSTREAMER
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2157 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2158 sound_changed3_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2159 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2160 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2161 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2162 const char *method = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2163
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2164 gtk_widget_set_sensitive(hbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2165 !strcmp(method, "automatic") ||
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2166 !strcmp(method, "esd"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2167 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2168 #endif /* USE_GSTREAMER */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2169
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2170
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2171 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2172 event_toggled(GtkCellRendererToggle *cell, gchar *pth, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2173 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2174 GtkTreeModel *model = (GtkTreeModel *)data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2175 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2176 GtkTreePath *path = gtk_tree_path_new_from_string(pth);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2177 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2178
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2179 gtk_tree_model_get_iter (model, &iter, path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2180 gtk_tree_model_get (model, &iter,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2181 2, &pref,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2182 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2183
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2184 purple_prefs_set_bool(pref, !gtk_cell_renderer_toggle_get_active(cell));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2185 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2186
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2187 gtk_list_store_set(GTK_LIST_STORE (model), &iter,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2188 0, !gtk_cell_renderer_toggle_get_active(cell),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2189 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2190
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2191 gtk_tree_path_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2192 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2193
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2194 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2195 test_sound(GtkWidget *button, gpointer i_am_NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2196 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2197 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2198 gboolean temp_enabled;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2199 gboolean temp_mute;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2200
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2201 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2202 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2203
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2204 temp_enabled = purple_prefs_get_bool(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2205 temp_mute = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/sound/mute");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2206
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2207 if (!temp_enabled) purple_prefs_set_bool(pref, TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2208 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2209
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2210 purple_sound_play_event(sound_row_sel, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2211
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2212 if (!temp_enabled) purple_prefs_set_bool(pref, FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2213 if (temp_mute) purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/sound/mute", TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2214
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2215 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2216 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2217
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2218 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2219 * Resets a sound file back to default.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2220 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2221 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2222 reset_sound(GtkWidget *button, gpointer i_am_also_NULL)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2223 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2224 gchar *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2225
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2226 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2227 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2228 purple_prefs_set_path(pref, "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2229 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2230
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2231 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)"));
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
2232
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
2233 pref_sound_generate_markup();
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2234 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2235
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2236 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2237 sound_chosen_cb(void *user_data, const char *filename)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2238 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2239 gchar *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2240 int sound;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2241
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2242 sound = GPOINTER_TO_INT(user_data);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2243
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2244 /* Set it -- and forget it */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2245 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2246 pidgin_sound_get_event_option(sound));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2247 purple_prefs_set_path(pref, filename);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2248 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2249
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2250 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2251 * If the sound we just changed is still the currently selected
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2252 * sound, then update the box showing the file name.
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2253 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2254 if (sound == sound_row_sel)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2255 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename);
23652
3204ee69eab2 Fixes the display problems with (option 1) sound themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23649
diff changeset
2256
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
2257 pref_sound_generate_markup();
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2258 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2259
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2260 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2261 select_sound(GtkWidget *button, gpointer being_NULL_is_fun)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2262 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2263 gchar *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2264 const char *filename;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2265
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2266 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2267 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2268 filename = purple_prefs_get_path(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2269 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2270
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2271 if (*filename == '\0')
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2272 filename = NULL;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2273
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2274 purple_request_file(prefs, _("Sound Selection"), filename, FALSE,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2275 G_CALLBACK(sound_chosen_cb), NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2276 NULL, NULL, NULL,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2277 GINT_TO_POINTER(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2278 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2279
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2280 #ifdef USE_GSTREAMER
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2281 static gchar *
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2282 prefs_sound_volume_format(GtkScale *scale, gdouble val)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2283 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2284 if(val < 15) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2285 return g_strdup_printf(_("Quietest"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2286 } else if(val < 30) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2287 return g_strdup_printf(_("Quieter"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2288 } else if(val < 45) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2289 return g_strdup_printf(_("Quiet"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2290 } else if(val < 55) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2291 return g_strdup_printf(_("Normal"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2292 } else if(val < 70) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2293 return g_strdup_printf(_("Loud"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2294 } else if(val < 85) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2295 return g_strdup_printf(_("Louder"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2296 } else {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2297 return g_strdup_printf(_("Loudest"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2298 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2299 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2300
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2301 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2302 prefs_sound_volume_changed(GtkRange *range)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2303 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2304 int val = (int)gtk_range_get_value(GTK_RANGE(range));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2305 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/sound/volume", val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2306 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2307 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2308
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2309 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2310 prefs_sound_sel(GtkTreeSelection *sel, GtkTreeModel *model)
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2311 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2312 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2313 GValue val;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2314 const char *file;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2315 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2316
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2317 if (! gtk_tree_selection_get_selected (sel, &model, &iter))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2318 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2319
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2320 val.g_type = 0;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2321 gtk_tree_model_get_value (model, &iter, 3, &val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2322 sound_row_sel = g_value_get_uint(&val);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2323
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2324 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2325 pidgin_sound_get_event_option(sound_row_sel));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2326 file = purple_prefs_get_path(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2327 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2328 if (sound_entry)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2329 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2330 g_value_unset (&val);
23649
5da5fe967d10 Working sound themes (option 1) theme is saved in prefs and there is no seperate custom theme, everything
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23648
diff changeset
2331
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
2332 pref_sound_generate_markup();
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2333 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2334
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2335
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2336 static void
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2337 mute_changed_cb(const char *pref_name,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2338 PurplePrefType pref_type,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2339 gconstpointer val,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2340 gpointer data)
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2341 {
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2342 GtkToggleButton *button = data;
24533
37232ecf7246 Fix some warnings:
Richard Laager <rlaager@pidgin.im>
parents: 24284
diff changeset
2343 gboolean muted = GPOINTER_TO_INT(val);
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2344
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2345 g_return_if_fail(!strcmp (pref_name, PIDGIN_PREFS_ROOT "/sound/mute"));
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2346
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2347 /* Block the handler that re-sets the preference. */
24533
37232ecf7246 Fix some warnings:
Richard Laager <rlaager@pidgin.im>
parents: 24284
diff changeset
2348 g_signal_handlers_block_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name);
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2349 gtk_toggle_button_set_active (button, muted);
24533
37232ecf7246 Fix some warnings:
Richard Laager <rlaager@pidgin.im>
parents: 24284
diff changeset
2350 g_signal_handlers_unblock_matched(button, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, (gpointer)pref_name);
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2351 }
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2352
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2353
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2354 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2355 sound_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2356 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2357 GtkWidget *ret;
28877
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2358 GtkWidget *vbox, *vbox2, *sw, *button;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2359 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2360 GtkTreeIter iter;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2361 GtkWidget *event_view;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2362 GtkListStore *event_store;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2363 GtkCellRenderer *rend;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2364 GtkTreeViewColumn *col;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2365 GtkTreeSelection *sel;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2366 GtkTreePath *path;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2367 GtkWidget *hbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2368 int j;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2369 const char *file;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2370 char *pref;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2371 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2372 GtkWidget *dd;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2373 GtkWidget *entry;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2374 const char *cmd;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2375 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2376
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2377 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2378 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2379
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2380 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2381
28877
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2382 vbox2 = pidgin_make_frame(ret, _("Sound Options"));
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2383
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2384 #ifndef _WIN32
28877
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2385 dd = pidgin_prefs_dropdown(vbox2, _("_Method:"), PURPLE_PREF_STRING,
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2386 PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2387 _("Console beep"), "beep",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2388 #ifdef USE_GSTREAMER
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2389 _("Automatic"), "automatic",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2390 "ESD", "esd",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2391 "ALSA", "alsa",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2392 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2393 _("Command"), "custom",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2394 _("No sounds"), "none",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2395 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2396 gtk_size_group_add_widget(sg, dd);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2397 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2398
28877
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2399 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2400 gtk_box_pack_start(GTK_BOX(vbox2), vbox, FALSE, FALSE, 0);
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2401
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2402 entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2403 gtk_editable_set_editable(GTK_EDITABLE(entry), TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2404 cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2405 if(cmd)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2406 gtk_entry_set_text(GTK_ENTRY(entry), cmd);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2407 g_signal_connect(G_OBJECT(entry), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2408 G_CALLBACK(sound_cmd_yeah), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2409
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2410 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Sound c_ommand:\n(%s for filename)"), sg, entry, TRUE, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2411 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2412 sound_changed1_cb, hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2413 gtk_widget_set_sensitive(hbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2414 !strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2415 "custom"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2416 #endif /* _WIN32 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2417
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2418 button = pidgin_prefs_checkbox(_("M_ute sounds"), PIDGIN_PREFS_ROOT "/sound/mute", vbox);
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2419 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/mute", mute_changed_cb, button);
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2420
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2421 pidgin_prefs_checkbox(_("Sounds when conversation has _focus"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2422 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox);
24268
e725d9fa4cf4 Prefs/Sounds: add some mnemonics
Will Thompson <resiak@pidgin.im>
parents: 24267
diff changeset
2423 pidgin_prefs_dropdown(vbox, _("_Enable sounds:"),
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2424 PURPLE_PREF_INT, "/purple/sound/while_status",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2425 _("Only when available"), 1,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2426 _("Only when not available"), 2,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2427 _("Always"), 3,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2428 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2429
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2430 #ifdef USE_GSTREAMER
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2431 sw = gtk_hscale_new_with_range(0.0, 100.0, 5.0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2432 gtk_range_set_increments(GTK_RANGE(sw), 5.0, 25.0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2433 gtk_range_set_value(GTK_RANGE(sw), purple_prefs_get_int(PIDGIN_PREFS_ROOT "/sound/volume"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2434 g_signal_connect (G_OBJECT (sw), "format-value",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2435 G_CALLBACK (prefs_sound_volume_format),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2436 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2437 g_signal_connect (G_OBJECT (sw), "value-changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2438 G_CALLBACK (prefs_sound_volume_changed),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2439 NULL);
24268
e725d9fa4cf4 Prefs/Sounds: add some mnemonics
Will Thompson <resiak@pidgin.im>
parents: 24267
diff changeset
2440 hbox = pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("V_olume:"), NULL, sw, TRUE, NULL);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2441
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2442 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2443 sound_changed3_cb, hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2444 sound_changed3_cb(PIDGIN_PREFS_ROOT "/sound/method", PURPLE_PREF_STRING,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2445 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), hbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2446 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2447
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2448 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2449 gtk_widget_set_sensitive(vbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2450 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2451 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2452 sound_changed2_cb, vbox);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2453 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2454 vbox = pidgin_make_frame(ret, _("Sound Events"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2455
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2456 /* The following is an ugly hack to make the frame expand so the
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2457 * sound events list is big enough to be usable */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2458 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2459 GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2460 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2461 TRUE, 0, GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2462 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2463 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2464
23645
6901039a86fb Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23261
diff changeset
2465 /* SOUND SELECTION */
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2466 sw = gtk_scrolled_window_new(NULL,NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2467 gtk_widget_set_size_request(sw, -1, 100);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2468 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2469 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2470
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2471 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2472 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2473
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2474 for (j=0; j < PURPLE_NUM_SOUNDS; j++) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2475 char *pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/enabled/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2476 pidgin_sound_get_event_option(j));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2477 const char *label = pidgin_sound_get_event_label(j);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2478
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2479 if (label == NULL) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2480 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2481 continue;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2482 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2483
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2484 gtk_list_store_append (event_store, &iter);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2485 gtk_list_store_set(event_store, &iter,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2486 0, purple_prefs_get_bool(pref),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2487 1, _(label),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2488 2, pref,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2489 3, j,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2490 -1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2491 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2492 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2493
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2494 event_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(event_store));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2495
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2496 rend = gtk_cell_renderer_toggle_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2497 sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_view));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2498 g_signal_connect (G_OBJECT (sel), "changed",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2499 G_CALLBACK (prefs_sound_sel),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2500 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2501 g_signal_connect (G_OBJECT(rend), "toggled",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2502 G_CALLBACK(event_toggled), event_store);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2503 path = gtk_tree_path_new_first();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2504 gtk_tree_selection_select_path(sel, path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2505 gtk_tree_path_free(path);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2506
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2507 col = gtk_tree_view_column_new_with_attributes (_("Play"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2508 rend,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2509 "active", 0,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2510 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2511 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2512
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2513 rend = gtk_cell_renderer_text_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2514 col = gtk_tree_view_column_new_with_attributes (_("Event"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2515 rend,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2516 "text", 1,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2517 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2518 gtk_tree_view_append_column (GTK_TREE_VIEW(event_view), col);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2519 g_object_unref(G_OBJECT(event_store));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2520 gtk_container_add(GTK_CONTAINER(sw), event_view);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2521
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2522 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2523 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2524 sound_entry = gtk_entry_new();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2525 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2526 pidgin_sound_get_event_option(0));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2527 file = purple_prefs_get_path(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2528 g_free(pref);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2529 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2530 gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2531 gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, PIDGIN_HIG_BOX_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2532
23261
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2533 button = gtk_button_new_with_mnemonic(_("_Browse..."));
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2534 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_sound), NULL);
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2535 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2536
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2537 button = gtk_button_new_with_mnemonic(_("Pre_view"));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2538 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(test_sound), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2539 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2540
23261
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
2541 button = gtk_button_new_with_mnemonic(_("_Reset"));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2542 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(reset_sound), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2543 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2544
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2545 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2546 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2547
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2548 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2549 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2550
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2551
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2552 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2553 set_idle_away(PurpleSavedStatus *status)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2554 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2555 purple_prefs_set_int("/purple/savedstatus/idleaway", purple_savedstatus_get_creation_time(status));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2556 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2557
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2558 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2559 set_startupstatus(PurpleSavedStatus *status)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2560 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2561 purple_prefs_set_int("/purple/savedstatus/startup", purple_savedstatus_get_creation_time(status));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2562 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2563
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2564 static GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2565 away_page(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2566 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2567 GtkWidget *ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2568 GtkWidget *vbox;
28890
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2569 GtkWidget *hbox;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2570 GtkWidget *dd;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2571 GtkWidget *label;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2572 GtkWidget *button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2573 GtkWidget *select;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2574 GtkWidget *menu;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2575 GtkSizeGroup *sg;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2576
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2577 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2578 gtk_container_set_border_width (GTK_CONTAINER (ret), PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2579
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2580 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2581
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2582 /* Idle stuff */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2583 vbox = pidgin_make_frame(ret, _("Idle"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2584
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2585 dd = pidgin_prefs_dropdown(vbox, _("_Report idle time:"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2586 PURPLE_PREF_STRING, "/purple/away/idle_reporting",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2587 _("Never"), "none",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2588 _("From last sent message"), "purple",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2589 #if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2590 _("Based on keyboard or mouse use"), "system",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2591 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2592 NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2593 gtk_size_group_add_widget(sg, dd);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2594 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2595
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2596 select = pidgin_prefs_labeled_spin_button(vbox,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2597 _("_Minutes before becoming idle:"), "/purple/away/mins_before_away",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2598 1, 24 * 60, sg);
26396
7045f27f0a72 Move 'Minutes before becoming idle' above 'Change status when idle'
Paul Aurich <darkrain42@pidgin.im>
parents: 25911
diff changeset
2599
28890
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2600 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2601 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2602
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2603 button = pidgin_prefs_checkbox(_("Change to this status when _idle:"),
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2604 "/purple/away/away_when_idle", hbox);
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2605 gtk_size_group_add_widget(sg, button);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2606
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2607 /* TODO: Show something useful if we don't have any saved statuses. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2608 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away));
28890
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2609 gtk_size_group_add_widget(sg, menu);
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2610 gtk_box_pack_start(GTK_BOX(hbox), menu, FALSE, FALSE, 0);
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2611
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2612 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2613 G_CALLBACK(pidgin_toggle_sensitive), menu);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2614
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2615 if (!purple_prefs_get_bool("/purple/away/away_when_idle")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2616 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2617 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2618 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2619
28876
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2620 /* Away stuff */
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2621 vbox = pidgin_make_frame(ret, _("Away"));
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2622
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2623 dd = pidgin_prefs_dropdown(vbox, _("_Auto-reply:"),
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2624 PURPLE_PREF_STRING, "/purple/away/auto_reply",
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2625 _("Never"), "never",
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2626 _("When away"), "away",
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2627 _("When both away and idle"), "awayidle",
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2628 NULL);
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2629 gtk_size_group_add_widget(sg, dd);
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2630 gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
838570225428 Get rid of the "Auto-away" section on the status/idle tab. Move all those
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28875
diff changeset
2631
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2632 /* Signon status stuff */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2633 vbox = pidgin_make_frame(ret, _("Status at Startup"));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2634
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2635 button = pidgin_prefs_checkbox(_("Use status from last _exit at startup"),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2636 "/purple/savedstatus/startup_current_status", vbox);
28890
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2637 gtk_size_group_add_widget(sg, button);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2638
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2639 /* TODO: Show something useful if we don't have any saved statuses. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2640 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus));
28890
9b5cd2396414 Move the "Change status to" menu to be beside the checkbox controlling it.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28889
diff changeset
2641 gtk_size_group_add_widget(sg, menu);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2642 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2643 G_CALLBACK(pidgin_toggle_sensitive), menu);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2644 pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Status to a_pply at startup:"), sg, menu, TRUE, &label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2645 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2646 G_CALLBACK(pidgin_toggle_sensitive), label);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2647
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2648 if (purple_prefs_get_bool("/purple/savedstatus/startup_current_status")) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2649 gtk_widget_set_sensitive(GTK_WIDGET(menu), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2650 gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2651 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2652
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2653 gtk_widget_show_all(ret);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2654 g_object_unref(sg);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2655
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2656 return ret;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2657 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2658
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2659 static int
27607
1d8bffba0505 That was some seriously screwed up formatting.
Etan Reisner <deryni@pidgin.im>
parents: 27606
diff changeset
2660 prefs_notebook_add_page(const char *text, GtkWidget *page, int ind)
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2661 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2662 #if GTK_CHECK_VERSION(2,4,0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2663 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2664 #else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2665 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2666 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2667 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2668 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2669
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2670 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2671 prefs_notebook_init(void)
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2672 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2673 prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++);
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2674
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2675 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2676 /* We use the registered default browser in windows */
28888
b8638c677a20 Oops. If the user was running GNOME, he/she wouldn't see the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28887
diff changeset
2677 /* if the user is running Mac OS X, hide the browsers tab */
b8638c677a20 Oops. If the user was running GNOME, he/she wouldn't see the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28887
diff changeset
2678 if(purple_running_osx() == FALSE)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2679 prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2680 #endif
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2681
28851
53ce9979a29e Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28850
diff changeset
2682 prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++);
53ce9979a29e Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28850
diff changeset
2683 prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++);
53ce9979a29e Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28850
diff changeset
2684 prefs_notebook_add_page(_("Network"), network_page(), notebook_page++);
28888
b8638c677a20 Oops. If the user was running GNOME, he/she wouldn't see the proxy and browser
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28887
diff changeset
2685 prefs_notebook_add_page(_("Proxy"), proxy_page(), notebook_page++);
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2686
28851
53ce9979a29e Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28850
diff changeset
2687 prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2688 prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++);
28851
53ce9979a29e Reorder the tabs alphabetically. I left Interface at the top because it's our
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28850
diff changeset
2689 prefs_notebook_add_page(_("Themes"), theme_page(), notebook_page++);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2690 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2691
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2692 void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2693 pidgin_prefs_show(void)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2694 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2695 GtkWidget *vbox;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2696 GtkWidget *notebook;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2697 GtkWidget *button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2698
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2699 if (prefs) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2700 gtk_window_present(GTK_WINDOW(prefs));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2701 return;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2702 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2703
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2704 /* copy the preferences to tmp values...
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2705 * I liked "take affect immediately" Oh well :-( */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2706 /* (that should have been "effect," right?) */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2707
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2708 /* Back to instant-apply! I win! BU-HAHAHA! */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2709
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2710 /* Create the window */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2711 prefs = pidgin_create_dialog(_("Preferences"), PIDGIN_HIG_BORDER, "preferences", FALSE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2712 g_signal_connect(G_OBJECT(prefs), "destroy",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2713 G_CALLBACK(delete_prefs), NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2714
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2715 vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(prefs), FALSE, PIDGIN_HIG_BORDER);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2716
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2717 /* The notebook */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2718 prefsnotebook = notebook = gtk_notebook_new ();
28847
f97b2dc18d64 Change to side-tabs in the prefs window.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28841
diff changeset
2719 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_LEFT);
f97b2dc18d64 Change to side-tabs in the prefs window.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28841
diff changeset
2720 gtk_box_pack_start(GTK_BOX (vbox), notebook, FALSE, FALSE, 0);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2721 gtk_widget_show(prefsnotebook);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2722
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2723 button = pidgin_dialog_add_button(GTK_DIALOG(prefs), GTK_STOCK_CLOSE, NULL, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2724 g_signal_connect_swapped(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2725 G_CALLBACK(gtk_widget_destroy), prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2726
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2727 prefs_notebook_init();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2728
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
2729 /* Refresh the list of themes before showing the preferences window */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
2730 prefs_themes_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
2731
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2732 /* Show everything. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2733 gtk_widget_show(prefs);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2734 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2735
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2736 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2737 set_bool_pref(GtkWidget *w, const char *key)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2738 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2739 purple_prefs_set_bool(key,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2740 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2741 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2742
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2743 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2744 pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2745 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2746 GtkWidget *button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2747
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2748 button = gtk_check_button_new_with_mnemonic(text);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2749 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2750 purple_prefs_get_bool(key));
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2751
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2752 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2753
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2754 g_signal_connect(G_OBJECT(button), "clicked",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2755 G_CALLBACK(set_bool_pref), (char *)key);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2756
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2757 gtk_widget_show(button);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2758
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2759 return button;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2760 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2761
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2762 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2763 smiley_theme_pref_cb(const char *name, PurplePrefType type,
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2764 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2765 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2766 const char *themename = value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2767 GSList *themes;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2768
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2769 for (themes = smiley_themes; themes; themes = themes->next) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2770 struct smiley_theme *smile = themes->data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2771 if (smile->name && strcmp(themename, smile->name) == 0) {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2772 pidgin_themes_load_smiley_theme(smile->path, TRUE);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2773 break;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2774 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2775 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2776 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2777
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2778 void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2779 pidgin_prefs_init(void)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2780 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2781 purple_prefs_add_none(PIDGIN_PREFS_ROOT "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2782 purple_prefs_add_none("/plugins/gtk");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2783
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2784 #ifndef _WIN32
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2785 /* Browsers */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2786 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/browsers");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2787 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2788 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/browsers/command", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2789 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "mozilla");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2790 #endif
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2791
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2792 /* Plugins */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2793 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/plugins");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2794 purple_prefs_add_path_list(PIDGIN_PREFS_ROOT "/plugins/loaded", NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2795
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2796 /* File locations */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2797 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2798 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2799 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2800 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", "");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2801
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
2802 /* Themes */
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
2803 prefs_themes_init();
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
2804
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2805 /* Smiley Themes */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2806 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2807 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2808
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2809 /* Smiley Callbacks */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2810 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/smileys/theme",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2811 smiley_theme_pref_cb, NULL);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2812
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2813 pidgin_prefs_update_old();
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2814 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2815
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2816 void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2817 pidgin_prefs_update_old(void)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2818 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2819 const char *str;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2820
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2821 purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT);
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2822
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2823 /* Rename some old prefs */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2824 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2825 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2826 purple_prefs_rename("/purple/conversations/placement",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2827 PIDGIN_PREFS_ROOT "/conversations/placement");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2828
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2829 purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2830 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2831
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2832 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2833 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2834
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2835 /* this string pref moved into the core, try to be friendly */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2836 purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2837 if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2838 strcmp(str, "gaim") == 0)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2839 purple_prefs_set_string("/purple/away/idle_reporting", "purple");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2840
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2841 /* Remove some no-longer-used prefs */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2842 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2843 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2844 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2845 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/raise_on_events");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2846 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_group_count");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2847 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_warning_level");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2848 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/button_type");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2849 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ctrl_enter_sends");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2850 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/enter_sends");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2851 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/escape_closes");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2852 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/html_shortcuts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2853 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/icons_on_tabs");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2854 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/send_formatting");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2855 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_smileys");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2856 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/show_urls_as_links");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2857 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/smiley_shortcuts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2858 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_bgcolor");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2859 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_fgcolor");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2860 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font");
28878
ad51dac11c42 Kill the use of the GNOME document font and the prefs to override it. The font
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28877
diff changeset
2861 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/custom_font");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2862 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_size");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2863 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/old_tab_complete");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2864 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/tab_completion");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2865 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/hide_on_send");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2866 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2867 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2868 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2869 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2870 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2871 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2872 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2873 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2874 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2875
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2876 /* Convert old queuing prefs to hide_new 3-way pref. */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2877 if (purple_prefs_exists("/plugins/gtk/docklet/queue_messages") &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2878 purple_prefs_get_bool("/plugins/gtk/docklet/queue_messages"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2879 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2880 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "always");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2881 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2882 else if (purple_prefs_exists(PIDGIN_PREFS_ROOT "/away/queue_messages") &&
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2883 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/away/queue_messages"))
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2884 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2885 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new", "away");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2886 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2887 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2888 purple_prefs_remove(PIDGIN_PREFS_ROOT "/away");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2889 purple_prefs_remove("/plugins/gtk/docklet/queue_messages");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2890
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2891 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_width");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2892 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/default_height");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2893 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_width");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2894 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/im/default_height");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2895 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/x",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2896 PIDGIN_PREFS_ROOT "/conversations/im/x");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2897 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/y",
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2898 PIDGIN_PREFS_ROOT "/conversations/im/y");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2899 }

mercurial