pidgin/gtkprefs.c

Tue, 06 Nov 2018 14:06:57 -0600

author
Mike Ruprecht <cmaiku@gmail.com>
date
Tue, 06 Nov 2018 14:06:57 -0600
changeset 39281
1606931affee
parent 39269
3e6eb178b03b
parent 39280
1c91bf69b28c
child 39317
b31b810fe6db
permissions
-rw-r--r--

Merge pull request #408 with default to resolve conflicts

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 /* 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
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
3 * 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
4 * 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
5 * 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
6 *
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 * 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
8 * 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
9 * 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
10 * (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
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 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
13 * 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
14 * 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
15 * 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
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 * 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
18 * 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
19 * 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
20 *
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 */
39264
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
22 #include <talkatu.h>
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
23
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
24 #include "internal.h"
34241
8b905ef8081d Fix build with older glib versions
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34225
diff changeset
25 #include "glibcompat.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
26 #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
27
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 "debug.h"
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
29 #include "http.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
30 #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
31 #include "notify.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
32 #include "prefs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
33 #include "proxy.h"
36543
a8c3fecee2d3 Renamed prpl.[ch] to protocol.[ch]
Ankit Vani <a@nevitus.org>
parents: 34883
diff changeset
34 #include "protocol.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
35 #include "request.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
36 #include "savedstatuses.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
37 #include "sound.h"
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
38 #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
39 #include "stun.h"
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
40 #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
41 #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
42 #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
43 #include "network.h"
33983
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
44 #include "keyring.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
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"
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
48 #include "gtkconv-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
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 "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
51 #include "gtksavedstatuses.h"
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
52 #include "gtksmiley-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
53 #include "gtksound.h"
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
54 #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
55 #include "gtkutils.h"
39152
37144ff35a91 Rename gtkdebug -> pidgindebug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38578
diff changeset
56 #include "pidgindebug.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
57 #include "pidginstock.h"
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
58 #ifdef USE_VV
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
59 #include "media-gst.h"
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
60 #include <gst/video/videooverlay.h>
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
61 #ifdef GDK_WINDOWING_WIN32
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
62 #include <gdk/gdkwin32.h>
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
63 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
64 #ifdef GDK_WINDOWING_X11
33512
ac7b43f34108 Fix compile error in Preferences for GStreamer-0.10.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33509
diff changeset
65 #include <gdk/gdkx.h>
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
66 #endif
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
67 #ifdef GDK_WINDOWING_QUARTZ
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
68 #include <gdk/gdkquartz.h>
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
69 #endif
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
70 #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
71
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33146
diff changeset
72 #include "gtk3compat.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
73
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
74 #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
75
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
76 /* 25MB */
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
77 #define PREFS_MAX_DOWNLOADED_THEME_SIZE 26214400
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
78
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
79 struct theme_info {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
80 gchar *type;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
81 gchar *extension;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
82 gchar *original_name;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
83 };
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
84
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
85 typedef struct _PidginPrefCombo PidginPrefCombo;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
86
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
87 typedef void (*PidginPrefsBindDropdownCallback)(GtkComboBox *combo_box,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
88 PidginPrefCombo *combo);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
89
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
90 struct _PidginPrefCombo {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
91 GtkWidget *combo;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
92 PurplePrefType type;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
93 const gchar *key;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
94 union {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
95 const char *string;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
96 int integer;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
97 gboolean boolean;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
98 } value;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
99 gint previously_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
100 gint current_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
101 PidginPrefsBindDropdownCallback cb;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
102 };
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
103
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
104 struct _PidginPrefsWindow {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
105 GtkDialog parent;
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
106
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
107 /* Notebook */
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
108 GtkWidget *notebook;
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
109
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
110 /* Interface page */
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
111 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
112 PidginPrefCombo docklet;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
113 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
114 PidginPrefCombo hide_new;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
115 } im;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
116 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
117 GtkWidget *minimize_new_convs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
118 } win32;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
119 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
120 GtkWidget *tabs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
121 GtkWidget *tabs_vbox;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
122 GtkWidget *close_on_tabs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
123 PidginPrefCombo tab_side;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
124 PidginPrefCombo placement;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
125 } conversations;
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
126 } iface;
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
127
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
128 /* Browser page */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
129 struct {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
130 GtkWidget *page;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
131 GtkWidget *stack;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
132 /* GNOME version */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
133 GtkWidget *gnome_not_found;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
134 GtkWidget *gnome_program;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
135 gchar *gnome_program_path;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
136 /* Non-GNOME version */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
137 PidginPrefCombo browser;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
138 GtkWidget *place_hbox;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
139 PidginPrefCombo place;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
140 GtkWidget *manual_command_hbox;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
141 GtkWidget *manual_command;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
142 } browser;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
143
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
144 /* Conversations page */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
145 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
146 PidginPrefCombo notification_chat;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
147 GtkWidget *show_incoming_formatting;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
148 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
149 GtkWidget *close_immediately;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
150 GtkWidget *show_buddy_icons;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
151 GtkWidget *animate_buddy_icons;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
152 GtkWidget *send_typing;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
153 } im;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
154 GtkWidget *spellcheck;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
155 GtkWidget *use_smooth_scrolling;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
156 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
157 GtkWidget *blink_im;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
158 } win32;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
159 GtkWidget *resize_custom_smileys;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
160 GtkWidget *custom_smileys_size;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
161 GtkWidget *minimum_entry_lines;
39264
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
162 GtkTextBuffer *format_buffer;
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
163 GtkWidget *format_view;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
164 /* Win32 specific frame */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
165 GtkWidget *font_frame;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
166 GtkWidget *use_theme_font;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
167 GtkWidget *custom_font_hbox;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
168 GtkWidget *custom_font;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
169 } conversations;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
170
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
171 /* Logging page */
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
172 struct {
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
173 PidginPrefCombo format;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
174 GtkWidget *log_ims;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
175 GtkWidget *log_chats;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
176 GtkWidget *log_system;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
177 } logging;
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
178
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
179 /* Network page */
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
180 struct {
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
181 GtkWidget *stun_server;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
182 GtkWidget *auto_ip;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
183 GtkWidget *public_ip;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
184 GtkWidget *public_ip_hbox;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
185 GtkWidget *map_ports;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
186 GtkWidget *ports_range_use;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
187 GtkWidget *ports_range_hbox;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
188 GtkWidget *ports_range_start;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
189 GtkWidget *ports_range_end;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
190 GtkWidget *turn_server;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
191 GtkWidget *turn_port_udp;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
192 GtkWidget *turn_port_tcp;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
193 GtkWidget *turn_username;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
194 GtkWidget *turn_password;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
195 } network;
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
196
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
197 /* Proxy page */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
198 struct {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
199 GtkWidget *stack;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
200 /* GNOME version */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
201 GtkWidget *gnome_not_found;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
202 GtkWidget *gnome_program;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
203 gchar *gnome_program_path;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
204 /* Non-GNOME version */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
205 GtkWidget *socks4_remotedns;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
206 PidginPrefCombo type;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
207 GtkWidget *options;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
208 GtkWidget *host;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
209 GtkWidget *port;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
210 GtkWidget *username;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
211 GtkWidget *password;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
212 } proxy;
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
213
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
214 /* Away page */
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
215 struct {
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
216 PidginPrefCombo idle_reporting;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
217 GtkWidget *mins_before_away;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
218 GtkWidget *idle_hbox;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
219 GtkWidget *away_when_idle;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
220 PidginPrefCombo auto_reply;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
221 GtkWidget *startup_current_status;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
222 GtkWidget *startup_hbox;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
223 GtkWidget *startup_label;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
224 } away;
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
225 };
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
226
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
227 /* Main dialog */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
228 static PidginPrefsWindow *prefs = 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
229
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
230 /* Themes page */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
231 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
232 static GtkWidget *prefs_blist_themes_combo_box;
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
233 static GtkWidget *prefs_conv_themes_combo_box;
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
234 static GtkWidget *prefs_conv_variants_combo_box;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
235 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
236 static GtkWidget *prefs_smiley_themes_combo_box;
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
237 static PurpleHttpConnection *prefs_conv_themes_running_request = NULL;
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
238
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
239 /* Keyrings page */
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
240 static GtkWidget *keyring_page_instance = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
241 static GtkComboBox *keyring_combo = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
242 static GtkBox *keyring_vbox = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
243 static PurpleRequestFields *keyring_settings = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
244 static GList *keyring_settings_fields = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
245 static GtkWidget *keyring_apply = NULL;
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
246
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
247 /* Sound theme specific */
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
248 static GtkWidget *sound_entry = NULL;
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
249 static int sound_row_sel = 0;
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
250 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
251
29151
e7102801c04b Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29150
diff changeset
252 /* These exist outside the lifetime of the prefs dialog */
e7102801c04b Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29150
diff changeset
253 static GtkListStore *prefs_sound_themes;
e7102801c04b Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29150
diff changeset
254 static GtkListStore *prefs_blist_themes;
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
255 static GtkListStore *prefs_conv_themes;
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
256 static GtkListStore *prefs_conv_variants;
29151
e7102801c04b Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29150
diff changeset
257 static GtkListStore *prefs_status_icon_themes;
e7102801c04b Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29150
diff changeset
258 static GtkListStore *prefs_smiley_themes;
e7102801c04b Oops, the GtkListStore's for the themes have a lifetime that extends over
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29150
diff changeset
259
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
260 #ifdef USE_VV
33506
1ed332c1975d Rearrange things slightly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33505
diff changeset
261
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
262 static GtkWidget *voice_level;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
263 static GtkWidget *voice_threshold;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
264 static GtkWidget *voice_volume;
33506
1ed332c1975d Rearrange things slightly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33505
diff changeset
265 static GstElement *voice_pipeline;
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
266
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
267 static GtkWidget *video_drawing_area;
33506
1ed332c1975d Rearrange things slightly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33505
diff changeset
268 static GstElement *video_pipeline;
1ed332c1975d Rearrange things slightly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33505
diff changeset
269
1ed332c1975d Rearrange things slightly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33505
diff changeset
270 #endif
1ed332c1975d Rearrange things slightly.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33505
diff changeset
271
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
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 * 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
274 */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
275 G_DEFINE_TYPE(PidginPrefsWindow, pidgin_prefs_window, GTK_TYPE_DIALOG);
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
276 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
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 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
279 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
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 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
282 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
283
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
284 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
285
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 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
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
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 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
290 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
291 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
292 {
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 GtkWidget *spin;
32394
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 32391
diff changeset
294 GtkAdjustment *adjust;
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
295 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
296
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 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
298
33172
9fb9057fc55c Fix warnings about GtkAdjustments on GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33170
diff changeset
299 adjust = GTK_ADJUSTMENT(gtk_adjustment_new(val, min, max, 1, 1, 0));
9fb9057fc55c Fix warnings about GtkAdjustments on GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33170
diff changeset
300 spin = gtk_spin_button_new(adjust, 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
301 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
302 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
303 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
304 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
305 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
306 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
307 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
308 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
309
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 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
311 }
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
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 static void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
314 pidgin_prefs_bind_spin_button(const char *key, GtkWidget *spin)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
315 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
316 GtkAdjustment *adjust;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
317 int val;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
318
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
319 val = purple_prefs_get_int(key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
320
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
321 adjust = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
322 gtk_adjustment_set_value(adjust, val);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
323 g_object_set_data(G_OBJECT(spin), "val", (char *)key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
324 g_signal_connect(G_OBJECT(adjust), "value-changed",
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
325 G_CALLBACK(update_spin_value), GTK_WIDGET(spin));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
326 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
327
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
328 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
329 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
330 {
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
331 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
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 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
334 }
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 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
337 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
338 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
339 {
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 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
341 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
342
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 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
344
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
345 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
346 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
347 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
348 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
349 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
350
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 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
352 }
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
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
354 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
355 pidgin_prefs_bind_entry(const char *key, GtkWidget *entry)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
356 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
357 const gchar *value;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
358
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
359 value = purple_prefs_get_string(key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
360
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
361 gtk_entry_set_text(GTK_ENTRY(entry), value);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
362 g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(entry_set),
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
363 (char*)key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
364 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
365
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
366 GtkWidget *
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
367 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
368 const char *key, GtkSizeGroup *sg)
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
369 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
370 GtkWidget *entry;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
371 const gchar *value;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
372
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
373 value = purple_prefs_get_string(key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
374
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
375 entry = gtk_entry_new();
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
376 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
377 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
378 g_signal_connect(G_OBJECT(entry), "changed",
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
379 G_CALLBACK(entry_set), (char*)key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
380 gtk_widget_show(entry);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
381
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
382 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
383 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
384
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
385 /* TODO: Maybe move this up somewheres... */
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
386 enum {
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
387 PREF_DROPDOWN_TEXT,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
388 PREF_DROPDOWN_VALUE,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
389 PREF_DROPDOWN_COUNT
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
390 };
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
391
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
392 typedef struct
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
393 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
394 PurplePrefType type;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
395 union {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
396 const char *string;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
397 int integer;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
398 gboolean boolean;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
399 } value;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
400 } PidginPrefValue;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
401
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
402 typedef void (*PidginPrefsDropdownCallback)(GtkComboBox *combo_box,
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
403 PidginPrefValue value);
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
404
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
405 static void
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
406 dropdown_set(GtkComboBox *combo_box, gpointer _cb)
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
407 {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
408 PidginPrefsDropdownCallback cb = _cb;
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
409 GtkTreeIter iter;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
410 GtkTreeModel *tree_model;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
411 PidginPrefValue active;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
412
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
413 tree_model = gtk_combo_box_get_model(combo_box);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
414 if (!gtk_combo_box_get_active_iter(combo_box, &iter))
32379
a983d17d92d3 With 2.7.0, we don't need these GTK_CHECK_VERSION's any more.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32378
diff changeset
415 return;
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
416 active.type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(combo_box),
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
417 "type"));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
418
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
419 g_object_set_data(G_OBJECT(combo_box), "previously_active",
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
420 g_object_get_data(G_OBJECT(combo_box), "current_active"));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
421 g_object_set_data(G_OBJECT(combo_box), "current_active",
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
422 GINT_TO_POINTER(gtk_combo_box_get_active(combo_box)));
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
423
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
424 if (active.type == PURPLE_PREF_INT) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
425 gtk_tree_model_get(tree_model, &iter, PREF_DROPDOWN_VALUE,
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
426 &active.value.integer, -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
427 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
428 else if (active.type == PURPLE_PREF_STRING) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
429 gtk_tree_model_get(tree_model, &iter, PREF_DROPDOWN_VALUE,
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
430 &active.value.string, -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
431 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
432 else if (active.type == PURPLE_PREF_BOOLEAN) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
433 gtk_tree_model_get(tree_model, &iter, PREF_DROPDOWN_VALUE,
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
434 &active.value.boolean, -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
435 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
436
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
437 cb(combo_box, active);
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
438 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
439
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
440 static void pidgin_prefs_dropdown_revert_active(GtkComboBox *combo_box)
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
441 {
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
442 gint previously_active;
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
443
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
444 g_return_if_fail(combo_box != NULL);
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
445
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
446 previously_active = GPOINTER_TO_INT(g_object_get_data(
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
447 G_OBJECT(combo_box), "previously_active"));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
448 g_object_set_data(G_OBJECT(combo_box), "current_active",
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
449 GINT_TO_POINTER(previously_active));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
450
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
451 gtk_combo_box_set_active(combo_box, previously_active);
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
452 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
453
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
454 static GtkWidget *
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
455 pidgin_prefs_dropdown_from_list_with_cb(GtkWidget *box, const gchar *title,
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
456 GtkComboBox **dropdown_out, GList *menuitems,
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
457 PidginPrefValue initial, PidginPrefsDropdownCallback cb)
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
458 {
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
459 GtkWidget *dropdown;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
460 GtkWidget *label = NULL;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
461 gchar *text;
32904
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
462 GtkListStore *store = NULL;
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
463 GtkTreeIter iter;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
464 GtkTreeIter active;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
465 GtkCellRenderer *renderer;
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
466 gpointer current_active;
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
467
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
468 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
469
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
470 if (initial.type == PURPLE_PREF_INT) {
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
471 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_INT);
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
472 } else if (initial.type == PURPLE_PREF_STRING) {
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
473 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_STRING);
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
474 } else if (initial.type == PURPLE_PREF_BOOLEAN) {
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
475 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_BOOLEAN);
32904
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
476 } else {
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
477 g_warn_if_reached();
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
478 return 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
479 }
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
480
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
481 dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
482 if (dropdown_out != NULL)
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
483 *dropdown_out = GTK_COMBO_BOX(dropdown);
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
484 g_object_set_data(G_OBJECT(dropdown), "type", GINT_TO_POINTER(initial.type));
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
485
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
486 while (menuitems != NULL && (text = (char *)menuitems->data) != NULL) {
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
487 int int_value = 0;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
488 const char *str_value = NULL;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
489 gboolean bool_value = FALSE;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
490
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
491 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
492 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
493
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
494 gtk_list_store_append(store, &iter);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
495 gtk_list_store_set(store, &iter,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
496 PREF_DROPDOWN_TEXT, text,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
497 -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
498
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
499 if (initial.type == PURPLE_PREF_INT) {
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
500 int_value = GPOINTER_TO_INT(menuitems->data);
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
501 gtk_list_store_set(store, &iter,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
502 PREF_DROPDOWN_VALUE, int_value,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
503 -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
504 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
505 else if (initial.type == 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
506 str_value = (const char *)menuitems->data;
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
507 gtk_list_store_set(store, &iter,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
508 PREF_DROPDOWN_VALUE, str_value,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
509 -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
510 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
511 else if (initial.type == PURPLE_PREF_BOOLEAN) {
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
512 bool_value = (gboolean)GPOINTER_TO_INT(menuitems->data);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
513 gtk_list_store_set(store, &iter,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
514 PREF_DROPDOWN_VALUE, bool_value,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
515 -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
516 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
517
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
518 if ((initial.type == PURPLE_PREF_INT &&
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
519 initial.value.integer == int_value) ||
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
520 (initial.type == PURPLE_PREF_STRING &&
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
521 purple_strequal(initial.value.string, str_value)) ||
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
522 (initial.type == PURPLE_PREF_BOOLEAN &&
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
523 (initial.value.boolean == bool_value))) {
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
524
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
525 active = 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
526 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
527
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
528 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
529 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
530
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
531 renderer = gtk_cell_renderer_text_new();
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
532 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
533 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
534 "text", 0,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
535 NULL);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
536
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
537 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dropdown), &active);
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
538 current_active = GINT_TO_POINTER(gtk_combo_box_get_active(GTK_COMBO_BOX(
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
539 dropdown)));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
540 g_object_set_data(G_OBJECT(dropdown), "current_active", current_active);
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
541 g_object_set_data(G_OBJECT(dropdown), "previously_active", current_active);
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
542
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
543 g_signal_connect(G_OBJECT(dropdown), "changed",
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
544 G_CALLBACK(dropdown_set), cb);
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
545
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
546 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
547
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
548 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
549 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
550
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
551 static void
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
552 pidgin_prefs_dropdown_from_list_cb(GtkComboBox *combo_box,
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
553 PidginPrefValue value)
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
554 {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
555 const char *key;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
556
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
557 key = g_object_get_data(G_OBJECT(combo_box), "key");
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
558
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
559 if (value.type == PURPLE_PREF_INT) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
560 purple_prefs_set_int(key, value.value.integer);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
561 } else if (value.type == PURPLE_PREF_STRING) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
562 purple_prefs_set_string(key, value.value.string);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
563 } else if (value.type == PURPLE_PREF_BOOLEAN) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
564 purple_prefs_set_bool(key, value.value.boolean);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
565 } else {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
566 g_return_if_reached();
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
567 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
568 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
569
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
570 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
571 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
572 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
573 {
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
574 PidginPrefValue initial;
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
575 GtkComboBox *dropdown = NULL;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
576 GtkWidget *label;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
577
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
578 initial.type = type;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
579 if (type == PURPLE_PREF_INT) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
580 initial.value.integer = purple_prefs_get_int(key);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
581 } else if (type == PURPLE_PREF_STRING) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
582 initial.value.string = purple_prefs_get_string(key);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
583 } else if (type == PURPLE_PREF_BOOLEAN) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
584 initial.value.boolean = purple_prefs_get_bool(key);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
585 } else {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
586 g_return_val_if_reached(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
587 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
588
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
589 label = pidgin_prefs_dropdown_from_list_with_cb(box, title, &dropdown,
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
590 menuitems, initial, pidgin_prefs_dropdown_from_list_cb);
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
591
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
592 g_object_set_data(G_OBJECT(dropdown), "key", (gpointer)key);
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
593
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
594 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
595 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
596
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
597 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
598 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
599 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
600 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
601 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
602 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
603 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
604 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
605 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
606 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
607
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
608 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
609 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
610
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
611 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
612 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
613
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
614 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
615
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
616 if (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
617 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
618 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
619 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
620 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
621 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
622 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
623 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
624 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
625 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
626
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
627 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
628
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
629 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
630
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
631 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
632 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
633
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
634 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
635
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
636 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
637 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
638
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
639 static void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
640 pidgin_prefs_bind_dropdown_from_list_cb(GtkComboBox *combo_box,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
641 PidginPrefCombo *combo)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
642 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
643 if (combo->type == PURPLE_PREF_INT) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
644 purple_prefs_set_int(combo->key, combo->value.integer);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
645 } else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
646 purple_prefs_set_string(combo->key, combo->value.string);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
647 } else if (combo->type == PURPLE_PREF_BOOLEAN) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
648 purple_prefs_set_bool(combo->key, combo->value.boolean);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
649 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
650 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
651 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
652 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
653
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
654 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
655 bind_dropdown_set(GtkComboBox *combo_box, gpointer data)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
656 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
657 PidginPrefCombo *combo = data;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
658 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
659 GtkTreeModel *tree_model;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
660
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
661 tree_model = gtk_combo_box_get_model(combo_box);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
662 if (!gtk_combo_box_get_active_iter(combo_box, &iter))
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
663 return;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
664
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
665 combo->previously_active = combo->current_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
666 combo->current_active = gtk_combo_box_get_active(combo_box);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
667
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
668 if (combo->type == PURPLE_PREF_INT) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
669 gtk_tree_model_get(tree_model, &iter, PREF_DROPDOWN_VALUE,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
670 &combo->value.integer, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
671 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
672 else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
673 gtk_tree_model_get(tree_model, &iter, PREF_DROPDOWN_VALUE,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
674 &combo->value.string, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
675 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
676 else if (combo->type == PURPLE_PREF_BOOLEAN) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
677 gtk_tree_model_get(tree_model, &iter, PREF_DROPDOWN_VALUE,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
678 &combo->value.boolean, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
679 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
680
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
681 combo->cb(combo_box, combo);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
682 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
683
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
684 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
685 pidgin_prefs_bind_dropdown_from_list(PidginPrefCombo *combo, GList *menuitems)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
686 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
687 gchar *text;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
688 GtkListStore *store = NULL;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
689 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
690 GtkTreeIter active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
691
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
692 g_return_if_fail(menuitems != NULL);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
693
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
694 if (combo->type == PURPLE_PREF_INT) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
695 combo->value.integer = purple_prefs_get_int(combo->key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
696 } else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
697 combo->value.string = purple_prefs_get_string(combo->key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
698 } else if (combo->type == PURPLE_PREF_BOOLEAN) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
699 combo->value.boolean = purple_prefs_get_bool(combo->key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
700 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
701 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
702 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
703
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
704 store = GTK_LIST_STORE(
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
705 gtk_combo_box_get_model(GTK_COMBO_BOX(combo->combo)));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
706
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
707 while (menuitems != NULL && (text = (char *)menuitems->data) != NULL) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
708 int int_value = 0;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
709 const char *str_value = NULL;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
710 gboolean bool_value = FALSE;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
711
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
712 menuitems = g_list_next(menuitems);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
713 g_return_if_fail(menuitems != NULL);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
714
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
715 gtk_list_store_append(store, &iter);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
716 gtk_list_store_set(store, &iter,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
717 PREF_DROPDOWN_TEXT, text,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
718 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
719
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
720 if (combo->type == PURPLE_PREF_INT) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
721 int_value = GPOINTER_TO_INT(menuitems->data);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
722 gtk_list_store_set(store, &iter,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
723 PREF_DROPDOWN_VALUE, int_value,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
724 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
725 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
726 else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
727 str_value = (const char *)menuitems->data;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
728 gtk_list_store_set(store, &iter,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
729 PREF_DROPDOWN_VALUE, str_value,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
730 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
731 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
732 else if (combo->type == PURPLE_PREF_BOOLEAN) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
733 bool_value = (gboolean)GPOINTER_TO_INT(menuitems->data);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
734 gtk_list_store_set(store, &iter,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
735 PREF_DROPDOWN_VALUE, bool_value,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
736 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
737 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
738
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
739 if ((combo->type == PURPLE_PREF_INT &&
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
740 combo->value.integer == int_value) ||
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
741 (combo->type == PURPLE_PREF_STRING &&
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
742 purple_strequal(combo->value.string, str_value)) ||
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
743 (combo->type == PURPLE_PREF_BOOLEAN &&
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
744 (combo->value.boolean == bool_value))) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
745
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
746 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
747 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
748
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
749 menuitems = g_list_next(menuitems);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
750 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
751
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
752 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo->combo), &active);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
753 combo->current_active = gtk_combo_box_get_active(
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
754 GTK_COMBO_BOX(combo->combo));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
755 combo->previously_active = combo->current_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
756
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
757 combo->cb = pidgin_prefs_bind_dropdown_from_list_cb;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
758 g_signal_connect(G_OBJECT(combo->combo), "changed",
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
759 G_CALLBACK(bind_dropdown_set), combo);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
760 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
761
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
762 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
763 pidgin_prefs_bind_dropdown(PidginPrefCombo *combo)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
764 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
765 GtkListStore *store = NULL;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
766 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
767 GtkTreeIter active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
768
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
769 if (combo->type == PURPLE_PREF_INT) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
770 combo->value.integer = purple_prefs_get_int(combo->key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
771 } else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
772 combo->value.string = purple_prefs_get_string(combo->key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
773 } else if (combo->type == PURPLE_PREF_BOOLEAN) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
774 combo->value.boolean = purple_prefs_get_bool(combo->key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
775 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
776 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
777 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
778
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
779 store = GTK_LIST_STORE(
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
780 gtk_combo_box_get_model(GTK_COMBO_BOX(combo->combo)));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
781
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
782 if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
783 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
784 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
785
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
786 do {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
787 int int_value = 0;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
788 const char *str_value = NULL;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
789 gboolean bool_value = FALSE;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
790
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
791 if (combo->type == PURPLE_PREF_INT) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
792 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
793 PREF_DROPDOWN_VALUE, &int_value,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
794 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
795 if (combo->value.integer == int_value) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
796 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
797 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
798 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
799 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
800 else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
801 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
802 PREF_DROPDOWN_VALUE, &str_value,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
803 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
804 if (purple_strequal(combo->value.string, str_value)) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
805 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
806 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
807 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
808 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
809 else if (combo->type == PURPLE_PREF_BOOLEAN) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
810 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
811 PREF_DROPDOWN_VALUE, &bool_value,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
812 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
813 if (combo->value.boolean == bool_value) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
814 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
815 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
816 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
817 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
818 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
819
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
820 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo->combo), &active);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
821
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
822 combo->current_active = gtk_combo_box_get_active(
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
823 GTK_COMBO_BOX(combo->combo));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
824 combo->previously_active = combo->current_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
825
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
826 combo->cb = pidgin_prefs_bind_dropdown_from_list_cb;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
827 g_signal_connect(G_OBJECT(combo->combo), "changed",
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
828 G_CALLBACK(bind_dropdown_set), combo);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
829 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
830
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
831 static void
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
832 set_bool_pref(GtkWidget *w, const char *key)
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
833 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
834 purple_prefs_set_bool(key,
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
835 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
836 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
837
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
838 GtkWidget *
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
839 pidgin_prefs_checkbox(const char *text, const char *key, GtkWidget *page)
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
840 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
841 GtkWidget *button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
842
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
843 button = gtk_check_button_new_with_mnemonic(text);
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
844 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
845 purple_prefs_get_bool(key));
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
846
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
847 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
848
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
849 g_signal_connect(G_OBJECT(button), "clicked",
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
850 G_CALLBACK(set_bool_pref), (char *)key);
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
851
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
852 gtk_widget_show(button);
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
853
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
854 return button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
855 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
856
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
857 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
858 pidgin_prefs_bind_checkbox(const char *key, GtkWidget *button)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
859 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
860 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
861 purple_prefs_get_bool(key));
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
862 g_signal_connect(G_OBJECT(button), "toggled",
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
863 G_CALLBACK(set_bool_pref), (char *)key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
864 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
865
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
866 static void keyring_page_cleanup(void);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
867
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
868 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
869 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
870 {
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
871 /* Cancel HTTP requests */
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
872 purple_http_conn_cancel(prefs_conv_themes_running_request);
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
873 prefs_conv_themes_running_request = NULL;
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
874
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
875 /* 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
876 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
877
34188
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
878 purple_notify_close_with_handle(prefs);
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
879
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
880 /* 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
881 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
882
29150
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
883 /* NULL-ify globals */
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
884 sound_entry = NULL;
29150
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
885 sound_row_sel = 0;
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
886 prefs_sound_themes_loading = FALSE;
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
887
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
888 prefs_sound_themes_combo_box = NULL;
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
889 prefs_blist_themes_combo_box = NULL;
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
890 prefs_conv_themes_combo_box = NULL;
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
891 prefs_conv_variants_combo_box = NULL;
29150
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
892 prefs_status_themes_combo_box = NULL;
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
893 prefs_smiley_themes_combo_box = NULL;
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
894
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
895 keyring_page_cleanup();
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
896
35647
cdde8099c4f0 Fix two gtk3 warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35569
diff changeset
897 #ifdef USE_VV
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
898 voice_level = NULL;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
899 voice_threshold = NULL;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
900 voice_volume = NULL;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
901 video_drawing_area = NULL;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
902 #endif
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
903 g_free(prefs->proxy.gnome_program_path);
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
904 g_free(prefs->browser.gnome_program_path);
29150
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
905 prefs = 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
906 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
907
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
908 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
909 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
910 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
911 {
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
912
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
913 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
914 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
915 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
916 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
917 }
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
918
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
919 static void
28901
e0098fe083e4 Rename a smiley theme function to be a bit more descriptive.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28900
diff changeset
920 smileys_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
921 {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
922 GList *it;
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
923 GtkTreeIter iter;
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
924 gchar *description;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
925
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
926 description = get_theme_markup(_("none"), FALSE, _("Penguin Pimps"),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
927 _("Selecting this disables graphical emoticons."));
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
928 gtk_list_store_append(prefs_smiley_themes, &iter);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
929 gtk_list_store_set(prefs_smiley_themes, &iter,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
930 0, NULL, 1, description, 2, "none", -1);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
931 g_free(description);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
932
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
933 for (it = pidgin_smiley_theme_get_all(); it; it = g_list_next(it)) {
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
934 PidginSmileyTheme *theme = it->data;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
935
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
936 description = get_theme_markup(
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
937 _(pidgin_smiley_theme_get_name(theme)), FALSE,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
938 _(pidgin_smiley_theme_get_author(theme)),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
939 _(pidgin_smiley_theme_get_description(theme)));
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
940
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
941 gtk_list_store_append(prefs_smiley_themes, &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
942 gtk_list_store_set(prefs_smiley_themes, &iter,
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
943 0, pidgin_smiley_theme_get_icon(theme),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
944 1, description,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
945 2, pidgin_smiley_theme_get_name(theme),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
946 -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
947
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
948 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
949 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
950 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
951
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
952 /* 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
953 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
954 pref_sound_generate_markup(void)
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
955 {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
956 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
957 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
958 gchar *name, *markup;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
959 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
960 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
961
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
962 customized = pidgin_sound_is_customized();
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
963 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
964
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
965 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
966 do {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
967 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
968
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
969 print_custom = customized && name && purple_strequal(current_theme, name);
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
970
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
971 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
972 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
973 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
974 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
975 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
976 } else {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
977 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
978 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
979 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
980 }
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
981
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
982 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
983
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
984 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
985
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
986 g_free(name);
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
987 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
988
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
989 } 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
990 }
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
991 }
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
992
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
993 /* 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
994 static void
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
995 prefs_themes_sort(PurpleTheme *theme)
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
996 {
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
997 GdkPixbuf *pixbuf = NULL;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
998 GtkTreeIter iter;
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
999 gchar *image_full = NULL, *markup;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1000 const gchar *name, *author, *description;
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1001
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1002 if (PURPLE_IS_SOUND_THEME(theme)){
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1003
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
1004 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
1005 if (image_full != NULL){
31889
96183796df0c Start looking at the GError parameter every time we call these functions:
Mark Doliner <markdoliner@pidgin.im>
parents: 31831
diff changeset
1006 pixbuf = pidgin_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE);
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
1007 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
1008 } 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
1009 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
1010
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1011 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
1012 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
1013
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
1014 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
1015 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
1016
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1017 } 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
1018 GtkListStore *store;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1019
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1020 if (PIDGIN_IS_BLIST_THEME(theme))
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1021 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
1022 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
1023 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
1024
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
1025 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
1026 if (image_full != NULL){
31889
96183796df0c Start looking at the GError parameter every time we call these functions:
Mark Doliner <markdoliner@pidgin.im>
parents: 31831
diff changeset
1027 pixbuf = pidgin_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE);
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
1028 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
1029 } 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
1030 pixbuf = NULL;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1031
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1032 name = purple_theme_get_name(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1033 author = purple_theme_get_author(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1034 description = purple_theme_get_description(theme);
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1035
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
1036 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
1037
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1038 gtk_list_store_append(store, &iter);
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1039 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
1040
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1041 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
1042 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
1043 g_object_unref(G_OBJECT(pixbuf));
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1044
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1045 } else if (PIDGIN_IS_CONV_THEME(theme)) {
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1046 /* No image available? */
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1047
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1048 name = purple_theme_get_name(theme);
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1049 /* No author available */
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1050 /* No description available */
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1051
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1052 markup = get_theme_markup(name, FALSE, NULL, NULL);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1053
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1054 gtk_list_store_append(prefs_conv_themes, &iter);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1055 gtk_list_store_set(prefs_conv_themes, &iter, 1, markup, 2, name, -1);
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1056 }
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1057 }
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1058
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1059 static void
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1060 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
1061 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1062 GtkTreeIter iter;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1063 gchar *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1064 gboolean unset = TRUE;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1065
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1066 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
1067 do {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1068 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
1069
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
1070 if (purple_strequal(current_theme, theme)) {
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1071 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
1072 unset = FALSE;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1073 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1074
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1075 g_free(theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1076 } 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
1077 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1078
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1079 if (unset)
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1080 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
1081 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1082
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1083 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1084 prefs_themes_refresh(void)
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1085 {
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1086 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
1087 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
1088 GtkTreeIter iter;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1089
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
1090 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
1091 /* 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
1092 purple_theme_manager_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1093
35850
1abeda205d6c cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35748
diff changeset
1094 tmp = g_build_filename(PURPLE_DATADIR, "icons", "hicolor", "32x32",
1abeda205d6c cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35748
diff changeset
1095 "apps", "pidgin.png", NULL);
31889
96183796df0c Start looking at the GError parameter every time we call these functions:
Mark Doliner <markdoliner@pidgin.im>
parents: 31831
diff changeset
1096 pixbuf = pidgin_pixbuf_new_from_file_at_scale(tmp, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE);
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
1097 g_free(tmp);
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1098
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
1099 /* sound themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1100 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
1101 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
1102 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
1103
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
1104 /* blist themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1105 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
1106 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
1107 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
1108 _("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
1109 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
1110 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
1111
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1112 /* conversation themes */
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1113 gtk_list_store_clear(prefs_conv_themes);
32581
d86376d8e168 Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32563
diff changeset
1114 gtk_list_store_append(prefs_conv_themes, &iter);
d86376d8e168 Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32563
diff changeset
1115 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"),
d86376d8e168 Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32563
diff changeset
1116 _("The default Pidgin conversation theme"));
d86376d8e168 Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32563
diff changeset
1117 gtk_list_store_set(prefs_conv_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1);
d86376d8e168 Add the "default" theme to the beginning of the conversation
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32563
diff changeset
1118 g_free(tmp);
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1119
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1120 /* conversation theme variants */
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1121 gtk_list_store_clear(prefs_conv_variants);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1122
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1123 /* status icon themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1124 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
1125 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
1126 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
1127 _("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
1128 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
1129 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
1130 if (pixbuf)
48c271584931 Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <datallah@pidgin.im>
parents: 28627
diff changeset
1131 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
1132
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
1133 /* 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
1134 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
1135
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1136 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
1137 pref_sound_generate_markup();
28901
e0098fe083e4 Rename a smiley theme function to be a bit more descriptive.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28900
diff changeset
1138 smileys_refresh_theme_list();
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1139
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1140 /* set active */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1141 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
1142 prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"));
32563
27024ee86815 Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32562
diff changeset
1143 prefs_set_active_theme_combo(prefs_conv_themes_combo_box, prefs_conv_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/theme"));
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1144 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
1145 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
1146 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
1147 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1148
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1149 /* 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
1150 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1151 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
1152 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1153 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
1154
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1155 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
1156
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1157 prefs_conv_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1158
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1159 prefs_conv_variants = gtk_list_store_new(1, G_TYPE_STRING);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1160
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1161 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
1162
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
1163 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
1164 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1165
35455
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1166 /*
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1167 * prefs_theme_find_theme:
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1168 * @path: A directory containing a theme. The theme could be at the
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1169 * top level of this directory or in any subdirectory thereof.
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1170 * @type: The type of theme to load. The loader for this theme type
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1171 * will be used and this loader will determine what constitutes a
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1172 * "theme."
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1173 *
33562
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1174 * Attempt to load the given directory as a theme. If we are unable to
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1175 * open the path as a theme then we recurse into path and attempt to
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1176 * load each subdirectory that we encounter.
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1177 *
35455
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1178 * Returns: A new reference to a #PurpleTheme.
33562
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1179 */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1180 static PurpleTheme *
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1181 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
1182 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1183 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
1184 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
1185 const gchar *next;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1186
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1187 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
1188 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
1189
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1190 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
1191 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
1192
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1193 g_free(next_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1194 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1195
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1196 g_dir_close(dir);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1197
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1198 return theme;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1199 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1200
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
1201 /* 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
1202 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
1203 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
1204 {
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1205 FILE *src, *dest;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1206 gint chr = EOF;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1207
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1208 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
1209 return FALSE;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1210 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
1211 fclose(src);
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1212 return FALSE;
27451
6dcd55e2c594 Handle dest failing to open properly by closing the src handle.
Paul Aurich <darkrain42@pidgin.im>
parents: 27450
diff changeset
1213 }
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
1214
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1215 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
1216 fputc(chr, dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1217 }
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1218
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1219 fclose(dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1220 fclose(src);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1221
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1222 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
1223 }
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1224
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1225 static void
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1226 free_theme_info(struct theme_info *info)
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1227 {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1228 if (info != NULL) {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1229 g_free(info->type);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1230 g_free(info->extension);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1231 g_free(info->original_name);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1232 g_free(info);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1233 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1234 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1235
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1236 /* 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
1237 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1238 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
1239 {
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1240 #ifndef _WIN32
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1241 gchar *command;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1242 #endif
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1243 gchar *destdir;
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1244 const char *tail;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1245 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
1246 PurpleTheme *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1247
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1248 if (info == NULL)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1249 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1250
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1251 /* check the extension */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1252 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
1253
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1254 if (!tail) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1255 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
1256 return;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1257 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1258
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1259 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
1260
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1261 /* Just to be safe */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1262 g_strchomp(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1263
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
1264 if ((is_smiley_theme = purple_strequal(info->type, "smiley")))
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1265 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
1266 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
1267 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
1268
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1269 /* 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
1270 * 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
1271 if (is_archive) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1272 #ifndef _WIN32
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1273 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
1274 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
1275
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1276 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
1277 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
1278
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1279 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
1280 g_free(path_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1281 g_free(destdir_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1282
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1283 /* Fire! */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1284 if (system(command)) {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1285 purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL, NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1286 g_free(command);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1287 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1288 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
1289 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1290 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1291 #else
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1292 if (!winpidgin_gz_untar(path, destdir)) {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1293 purple_notify_error(NULL, NULL, _("Theme failed to unpack."), NULL, NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1294 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1295 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
1296 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1297 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1298 #endif
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1299 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1300
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1301 if (is_smiley_theme) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1302 /* 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
1303 prefs_themes_refresh();
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1304
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1305 } else if (is_archive) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1306 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
1307
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1308 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
1309 /* create the location for the theme */
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1310 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
1311 purple_theme_get_name(theme),
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1312 "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
1313
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1314 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
1315 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
1316
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1317 g_free(theme_dest);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1318 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
1319 purple_theme_get_name(theme),
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1320 "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
1321
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1322 /* move the entire directory to new location */
33563
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1323 if (g_rename(purple_theme_get_dir(theme), theme_dest)) {
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1324 purple_debug_error("gtkprefs", "Error renaming %s to %s: "
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1325 "%s\n", purple_theme_get_dir(theme), theme_dest,
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1326 g_strerror(errno));
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1327 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1328
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1329 g_free(theme_dest);
36029
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1330 if (g_remove(destdir) != 0) {
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1331 purple_debug_error("gtkprefs",
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1332 "couldn't remove temp (dest) path\n");
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1333 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1334 g_object_unref(theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1335
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1336 prefs_themes_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1337
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1338 } else {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1339 /* 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
1340 g_unlink(destdir);
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1341 purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL, NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1342 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1343
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1344 } 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
1345 gchar *temp_path, *temp_file;
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1346
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1347 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
1348
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1349 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
1350 /* 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
1351 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
1352
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1353 } 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
1354 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
1355 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
1356 g_free(source_name);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1357 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1358
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1359 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
1360 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
1361
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1362 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
1363 /* find the theme, could be in subfolder */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1364 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
1365
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1366 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
1367 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
1368 purple_theme_get_name(theme),
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1369 "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
1370
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1371 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
1372 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
1373
33563
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1374 if (g_rename(purple_theme_get_dir(theme), theme_dest)) {
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1375 purple_debug_error("gtkprefs", "Error renaming %s to %s: "
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1376 "%s\n", purple_theme_get_dir(theme), theme_dest,
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1377 g_strerror(errno));
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1378 }
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
1379
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1380 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
1381 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
1382
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1383 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
1384 } else {
35991
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1385 if (g_remove(temp_path) != 0) {
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1386 purple_debug_error("gtkprefs",
36002
31a8779e91d4 Merge release-2.x.y
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35989 35991
diff changeset
1387 "couldn't remove temp path");
35991
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1388 }
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1389 purple_notify_error(NULL, NULL, _("Theme failed to load."), NULL, 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
1390 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1391 } else {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1392 purple_notify_error(NULL, NULL, _("Theme failed to copy."), NULL, NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1393 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1394
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1395 g_free(temp_file);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1396 g_free(temp_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1397 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1398
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1399 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1400 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
1401 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1402
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1403 static void
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1404 theme_got_url(PurpleHttpConnection *http_conn, PurpleHttpResponse *response,
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1405 gpointer _info)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1406 {
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1407 struct theme_info *info = _info;
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1408 const gchar *themedata;
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1409 size_t len;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1410 FILE *f;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1411 gchar *path;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1412 size_t wc;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1413
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1414 g_assert(http_conn == prefs_conv_themes_running_request);
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1415 prefs_conv_themes_running_request = NULL;
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1416
34287
6cd0c77b1f6a HTTP: successful is spelled with one l
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34281
diff changeset
1417 if (!purple_http_response_is_successful(response)) {
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1418 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
1419 return;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1420 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1421
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1422 themedata = purple_http_response_get_data(response, &len);
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1423
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1424 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
1425 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
1426 if (wc != 1) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1427 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
1428 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1429 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1430 g_free(path);
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1431 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
1432 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1433 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1434 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1435
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1436 theme_install_theme(path, info);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1437
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1438 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1439 g_free(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1440 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1441
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1442 static void
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1443 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
1444 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
1445 {
32394
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 32391
diff changeset
1446 gchar *name = g_strchomp((gchar *)gtk_selection_data_get_data(sd));
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 32391
diff changeset
1447
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 32391
diff changeset
1448 if ((gtk_selection_data_get_length(sd) >= 0)
32422
c215bc5d85e4 Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32414
diff changeset
1449 && (gtk_selection_data_get_format(sd) == 8)) {
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1450 /* 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
1451 * 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
1452 gchar *temp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1453 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
1454 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
1455 info->extension = g_strdup(g_strrstr(name,"."));
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1456 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
1457 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
1458
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1459 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
1460 GError *converr = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1461 gchar *tmp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1462 /* 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
1463 * 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
1464 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
1465 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
1466 (converr ? converr->message :
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1467 "g_filename_from_uri error"));
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1468 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
1469 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1470 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1471 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
1472 g_free(tmp);
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1473 } else if (!g_ascii_strncasecmp(name, "http://", 7) ||
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1474 !g_ascii_strncasecmp(name, "https://", 8)) {
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1475 /* 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
1476 * will start to get interesting */
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1477 PurpleHttpRequest *hr;
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1478 purple_http_conn_cancel(prefs_conv_themes_running_request);
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1479
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1480 hr = purple_http_request_new(name);
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1481 purple_http_request_set_max_len(hr,
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1482 PREFS_MAX_DOWNLOADED_THEME_SIZE);
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1483 prefs_conv_themes_running_request = purple_http_request(
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1484 NULL, hr, theme_got_url, info);
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1485 purple_http_request_unref(hr);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1486 } else
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1487 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
1488
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1489 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
1490 }
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1491
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1492 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
1493 }
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1494
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1495 /* 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
1496 static GtkWidget *
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1497 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
1498 {
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1499 GtkCellRenderer *cell_rend;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1500 GtkWidget *combo_box;
28483
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1501 GtkTargetEntry te[3] = {
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1502 {"text/plain", 0, 0},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1503 {"text/uri-list", 0, 1},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1504 {"STRING", 0, 2}
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1505 };
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1506
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1507 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
1508
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1509 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
1510
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1511 cell_rend = gtk_cell_renderer_pixbuf_new();
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1512 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
1513 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
1514 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
1515
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1516 cell_rend = gtk_cell_renderer_text_new();
29391
b3df20769362 Expand and fill.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 29381
diff changeset
1517 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, TRUE);
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1518 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL);
29381
cc1e5ad24728 Remove/comment on some GTK_CHECK_VERSION calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29361
diff changeset
1519 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
1520
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1521 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
1522 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
1523
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1524 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
1525
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1526 return combo_box;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1527 }
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1528
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
1529 /* 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
1530 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
1531 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
1532 {
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
1533 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
1534 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
1535 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
1536 GtkTreeIter new_iter;
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
1537
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
1538 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
1539
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1540 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
1541
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1542 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
1543
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1544 /* 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
1545 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
1546 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
1547 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
1548 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
1549 g_free(pref);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1550 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1551
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1552 /* 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
1553 pref_sound_generate_markup();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1554
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1555 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
1556
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1557 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
1558 }
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
1559 }
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
1560
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
1561 /* 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
1562 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
1563 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
1564 {
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
1565 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
1566 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
1567
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
1568 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
1569
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
1570 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
1571
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
1572 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", new_theme);
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1573
32821
e0dc2c194bca Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32745
diff changeset
1574 #if 0
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1575 /* TODO: update smileys in sample_webview input box. */
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1576 update_smileys_in_webview_input_box(win->conversation.sample_webview);
32821
e0dc2c194bca Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32745
diff changeset
1577 #endif
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
1578
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
1579 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
1580 }
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
1581 }
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
1582
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1583
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
1584 /* 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
1585 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
1586 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
1587 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
1588 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
1589 {
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 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
1591 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
1592
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
1593 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
1594 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
1595
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 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
1597 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
1598 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
1599 } 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
1600 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
1601 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
1602 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
1603 /* 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
1604 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
1605 } 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
1606 /* 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
1607 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
1608 } 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
1609 /* 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
1610 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
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
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1613 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
1614 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
1615
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1616 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
1617 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1618
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
1619 /* 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
1620 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
1621 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
1622 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1623 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
1624 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
1625 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
1626
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1627 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
1628
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1629 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
1630
38265
ee28d52fe2ca Use conventional style for empty string check
qarkai <qarkai@gmail.com>
parents: 38262
diff changeset
1631 if(!name || *name)
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
1632 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
1633
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1634 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
1635
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1636 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
1637 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1638 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1639
32964
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1640 /* sets the current conversation theme variant */
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1641 static void
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1642 prefs_set_conv_variant_cb(GtkComboBox *combo_box, gpointer user_data)
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1643 {
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1644 PidginConvTheme *theme = NULL;
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1645 GtkTreeIter iter;
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1646 gchar *name = NULL;
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1647
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1648 if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(prefs_conv_themes_combo_box), &iter)) {
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1649 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1);
32992
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1650 if (name && *name)
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1651 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation"));
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1652 else
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1653 theme = PIDGIN_CONV_THEME(pidgin_conversations_get_default_theme());
32964
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1654 g_free(name);
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1655
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1656 if (gtk_combo_box_get_active_iter(combo_box, &iter)) {
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1657 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_variants), &iter, 0, &name, -1);
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1658 pidgin_conversation_theme_set_variant(theme, name);
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1659 g_free(name);
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1660 }
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1661 }
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1662 }
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1663
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1664 /* sets the current conversation theme */
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1665 static void
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1666 prefs_set_conv_theme_cb(GtkComboBox *combo_box, gpointer user_data)
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1667 {
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1668 GtkTreeIter iter;
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1669
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1670 if (gtk_combo_box_get_active_iter(combo_box, &iter)) {
32963
1b5222154b6c Correctly save the conversation theme pref when re-choosing the Default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32952
diff changeset
1671 gchar *name = NULL;
32992
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1672 PidginConvTheme *theme;
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1673 const char *current_variant;
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1674 const GList *variants;
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1675 gboolean unset = TRUE;
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1676
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1677 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1);
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1678
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1679 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/theme", name);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1680
32964
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1681 g_signal_handlers_block_by_func(prefs_conv_variants_combo_box,
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1682 prefs_set_conv_variant_cb, NULL);
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1683
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1684 /* Update list of variants */
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1685 gtk_list_store_clear(prefs_conv_variants);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1686
32992
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1687 if (name && *name)
32963
1b5222154b6c Correctly save the conversation theme pref when re-choosing the Default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32952
diff changeset
1688 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation"));
32992
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1689 else
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1690 theme = PIDGIN_CONV_THEME(pidgin_conversations_get_default_theme());
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1691
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1692 current_variant = pidgin_conversation_theme_get_variant(theme);
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1693
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1694 variants = pidgin_conversation_theme_get_variants(theme);
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1695 for (; variants && current_variant; variants = g_list_next(variants)) {
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1696 gtk_list_store_append(prefs_conv_variants, &iter);
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1697 gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1);
32963
1b5222154b6c Correctly save the conversation theme pref when re-choosing the Default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32952
diff changeset
1698
32992
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1699 if (g_str_equal(variants->data, current_variant)) {
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1700 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter);
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1701 unset = FALSE;
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1702 }
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1703 }
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1704
32992
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1705 if (unset)
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1706 gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0);
89f064bdd762 Add a conversation theme with no timestamps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32965
diff changeset
1707
32964
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1708 g_signal_handlers_unblock_by_func(prefs_conv_variants_combo_box,
6934c0712cdc Fix some boring asserts when using the Default conversation theme.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32963
diff changeset
1709 prefs_set_conv_variant_cb, NULL);
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1710 g_free(name);
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1711 }
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1712 }
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1713
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
1714 /* 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
1715 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
1716 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
1717 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1718 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
1719 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
1720 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
1721
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1722 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
1723
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1724 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
1725
38265
ee28d52fe2ca Use conventional style for empty string check
qarkai <qarkai@gmail.com>
parents: 38262
diff changeset
1726 if(!name || *name)
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
1727 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
1728
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1729 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
1730
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1731 pidgin_stock_load_status_icon_theme(theme);
34726
af52ff6660c0 Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents: 34708
diff changeset
1732 pidgin_blist_refresh(purple_blist_get_buddy_list());
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
1733 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1734 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1735
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
1736 static GtkWidget *
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1737 add_theme_prefs_combo(GtkWidget *vbox,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1738 GtkSizeGroup *combo_sg, GtkSizeGroup *label_sg,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1739 GtkListStore *theme_store,
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 30817
diff changeset
1740 GCallback combo_box_cb, gpointer combo_box_cb_user_data,
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1741 const char *label_str, const char *prefs_path,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1742 const char *theme_type)
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1743 {
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1744 GtkWidget *label;
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1745 GtkWidget *combo_box = NULL;
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
1746 GtkWidget *themesel_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE);
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1747
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1748 label = gtk_label_new(label_str);
39179
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
1749 gtk_label_set_xalign(GTK_LABEL(label), 0.0);
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
1750 gtk_label_set_yalign(GTK_LABEL(label), 0.5);
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1751 gtk_size_group_add_widget(label_sg, label);
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1752 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1753
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1754 combo_box = prefs_build_theme_combo_box(theme_store,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1755 purple_prefs_get_string(prefs_path),
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1756 theme_type);
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1757 g_signal_connect(G_OBJECT(combo_box), "changed",
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1758 (GCallback)combo_box_cb, combo_box_cb_user_data);
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1759 gtk_size_group_add_widget(combo_sg, combo_box);
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1760 gtk_box_pack_start(GTK_BOX(themesel_hbox), combo_box, TRUE, TRUE, 0);
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1761
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1762 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1763
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1764 return combo_box;
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1765 }
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1766
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1767 static GtkWidget *
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1768 add_child_theme_prefs_combo(GtkWidget *vbox, GtkSizeGroup *combo_sg,
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1769 GtkSizeGroup *label_sg, GtkListStore *theme_store,
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1770 GCallback combo_box_cb, gpointer combo_box_cb_user_data,
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1771 const char *label_str)
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1772 {
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1773 GtkWidget *label;
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1774 GtkWidget *combo_box;
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1775 GtkWidget *themesel_hbox;
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1776 GtkCellRenderer *cell_rend;
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1777
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
1778 themesel_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE);
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1779 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1780
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1781 label = gtk_label_new(label_str);
39179
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
1782 gtk_label_set_xalign(GTK_LABEL(label), 1.0);
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
1783 gtk_label_set_yalign(GTK_LABEL(label), 0.5);
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1784 gtk_size_group_add_widget(label_sg, label);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1785 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1786
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1787 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(theme_store));
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1788
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1789 cell_rend = gtk_cell_renderer_text_new();
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1790 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), cell_rend, TRUE);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1791 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "text", 0, NULL);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1792 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1793
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1794 g_signal_connect(G_OBJECT(combo_box), "changed",
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1795 (GCallback)combo_box_cb, combo_box_cb_user_data);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1796 gtk_size_group_add_widget(combo_sg, combo_box);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1797 gtk_box_pack_start(GTK_BOX(themesel_hbox), combo_box, TRUE, TRUE, 0);
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1798
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1799 return combo_box;
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1800 }
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1801
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1802 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
1803 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
1804 {
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1805 GtkWidget *label;
28900
229b187af5b5 Fix merge error
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28899
diff changeset
1806 GtkWidget *ret, *vbox;
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
1807 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
1808 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
1809
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
1810 ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_CAT_SPACE);
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
1811 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
1812
28895
e18ed9175076 Make a frame for the combo box theme selectors and make the labels left-aligned
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28894
diff changeset
1813 vbox = pidgin_make_frame(ret, _("Theme Selections"));
e18ed9175076 Make a frame for the combo box theme selectors and make the labels left-aligned
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28894
diff changeset
1814
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
1815 /* 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
1816 label = gtk_label_new(_("Select a theme that you would like to use from "
28903
0b574a9afbac Make the instructions wrap a bit nicer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28902
diff changeset
1817 "the lists below.\nNew themes can be installed by "
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
1818 "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
1819
39179
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
1820 gtk_label_set_xalign(GTK_LABEL(label), 0.0);
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
1821 gtk_label_set_yalign(GTK_LABEL(label), 0.5);
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
1822 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
1823
28903
0b574a9afbac Make the instructions wrap a bit nicer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28902
diff changeset
1824 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 0);
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
1825 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
1826
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
1827 /* Buddy List Themes */
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1828 prefs_blist_themes_combo_box = add_theme_prefs_combo(
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1829 vbox, combo_sg, label_sg, prefs_blist_themes,
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 30817
diff changeset
1830 (GCallback)prefs_set_blist_theme_cb, NULL,
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1831 _("Buddy List Theme:"), PIDGIN_PREFS_ROOT "/blist/theme", "blist");
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
1832
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1833 /* Conversation Themes */
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1834 prefs_conv_themes_combo_box = add_theme_prefs_combo(
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1835 vbox, combo_sg, label_sg, prefs_conv_themes,
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1836 (GCallback)prefs_set_conv_theme_cb, NULL,
32563
27024ee86815 Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32562
diff changeset
1837 _("Conversation Theme:"), PIDGIN_PREFS_ROOT "/conversations/theme", "conversation");
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
1838
32583
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1839 /* Conversation Theme Variants */
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1840 prefs_conv_variants_combo_box = add_child_theme_prefs_combo(
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1841 vbox, combo_sg, label_sg, prefs_conv_variants,
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1842 (GCallback)prefs_set_conv_variant_cb, NULL, _("\tVariant:"));
0308e54f7762 Add a separate combo box for selecting the theme variant, and actually
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32581
diff changeset
1843
32589
0722927d76ce Sort the variant list in the Preferences. It tends to be very
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32583
diff changeset
1844 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_conv_variants),
0722927d76ce Sort the variant list in the Preferences. It tends to be very
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32583
diff changeset
1845 0, GTK_SORT_ASCENDING);
0722927d76ce Sort the variant list in the Preferences. It tends to be very
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32583
diff changeset
1846
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
1847 /* Status Icon Themes */
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1848 prefs_status_themes_combo_box = add_theme_prefs_combo(
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1849 vbox, combo_sg, label_sg, prefs_status_icon_themes,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1850 (GCallback)prefs_set_status_icon_theme_cb, NULL,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1851 _("Status Icon Theme:"), PIDGIN_PREFS_ROOT "/status/icon-theme", "icon");
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
1852
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
1853 /* Sound Themes */
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1854 prefs_sound_themes_combo_box = add_theme_prefs_combo(
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1855 vbox, combo_sg, label_sg, prefs_sound_themes,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1856 (GCallback)prefs_set_sound_theme_cb, NULL,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1857 _("Sound Theme:"), PIDGIN_PREFS_ROOT "/sound/theme", "sound");
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
1858
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
1859 /* Smiley Themes */
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1860 prefs_smiley_themes_combo_box = add_theme_prefs_combo(
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1861 vbox, combo_sg, label_sg, prefs_smiley_themes,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1862 (GCallback)prefs_set_smiley_theme_cb, NULL,
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1863 _("Smiley Theme:"), PIDGIN_PREFS_ROOT "/smileys/theme", "smiley");
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
1864
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 /* 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
1866 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
1867 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
1868 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
1869 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
1870
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1871 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
1872
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1873 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
1874 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1875
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1876 static void
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1877 formatting_toggle_cb(TalkatuActionGroup *ag, GAction *action, const gchar *name, 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
1878 {
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1879 gboolean activated = talkatu_action_group_get_action_activated(ag, name);
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1880 if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_BOLD, name) != 0) {
32821
e0dc2c194bca Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32745
diff changeset
1881 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold",
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1882 activated);
39267
0e4718ab2f9b remove a stray tab
Gary Kramlich <grim@reaperworld.com>
parents: 39266
diff changeset
1883 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_ITALIC, name) != 0) {
32821
e0dc2c194bca Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32745
diff changeset
1884 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic",
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1885 activated);
39268
82cdabe4bd2f remove more stray tabs
Gary Kramlich <grim@reaperworld.com>
parents: 39267
diff changeset
1886 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_UNDERLINE, name) != 0) {
32821
e0dc2c194bca Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32745
diff changeset
1887 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline",
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1888 activated);
39268
82cdabe4bd2f remove more stray tabs
Gary Kramlich <grim@reaperworld.com>
parents: 39267
diff changeset
1889 } else if(g_ascii_strcasecmp(TALKATU_ACTION_FORMAT_STRIKETHROUGH, name) != 0) {
32821
e0dc2c194bca Replace the sample imhtml in the prefs panel with a webview widget.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32745
diff changeset
1890 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike",
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1891 activated);
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
1892 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1893 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1894
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1895 static void
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1896 bind_interface_page(PidginPrefsWindow *win)
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
1897 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1898 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
1899
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1900 /* System Tray */
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1901 win->iface.docklet.type = PURPLE_PREF_STRING;
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1902 win->iface.docklet.key = PIDGIN_PREFS_ROOT "/docklet/show";
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1903 pidgin_prefs_bind_dropdown(&win->iface.docklet);
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1904
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1905 win->iface.im.hide_new.type = PURPLE_PREF_STRING;
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1906 win->iface.im.hide_new.key = PIDGIN_PREFS_ROOT "/conversations/im/hide_new";
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1907 pidgin_prefs_bind_dropdown(&win->iface.im.hide_new);
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
1908
27592
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1909 #ifdef _WIN32
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1910 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/win32/minimize_new_convs",
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1911 win->iface.win32.minimize_new_convs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1912 #else
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1913 gtk_widget_hide(win->iface.win32.minimize_new_convs);
27592
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1914 #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
1915
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1916 /* All the tab options! */
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1917 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/tabs",
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1918 win->iface.conversations.tabs);
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
1919
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1920 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1921 * 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
1922 * 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
1923 */
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1924 g_object_bind_property(win->iface.conversations.tabs, "active",
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1925 win->iface.conversations.tabs_vbox, "sensitive",
39177
ff19cf5cc0dc Use g_object_bind_property for a conv tabs pref.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39173
diff changeset
1926 G_BINDING_SYNC_CREATE);
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
1927
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1928 pidgin_prefs_bind_checkbox(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1929 PIDGIN_PREFS_ROOT "/conversations/close_on_tabs",
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1930 win->iface.conversations.close_on_tabs);
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1931
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1932 win->iface.conversations.tab_side.type = PURPLE_PREF_INT;
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1933 win->iface.conversations.tab_side.key = PIDGIN_PREFS_ROOT "/conversations/tab_side";
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1934 pidgin_prefs_bind_dropdown(&win->iface.conversations.tab_side);
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1935
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1936 win->iface.conversations.placement.type = PURPLE_PREF_STRING;
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1937 win->iface.conversations.placement.key = PIDGIN_PREFS_ROOT "/conversations/placement";
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
1938 names = pidgin_conv_placement_get_options();
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1939 pidgin_prefs_bind_dropdown_from_list(
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1940 &win->iface.conversations.placement,
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1941 names);
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
1942 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
1943 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1944
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1945 /* This is also Win32-specific, but must be visible for Glade binding. */
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1946 static void
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1947 apply_custom_font(GtkWidget *unused, PidginPrefsWindow *win)
29361
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1948 {
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1949 PangoFontDescription *desc = NULL;
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1950 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) {
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1951 const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1952 desc = pango_font_description_from_string(font);
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1953 }
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1954
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1955 gtk_widget_override_font(win->conversations.format_view, desc);
29361
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1956 if (desc)
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1957 pango_font_description_free(desc);
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1958
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1959 }
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1960
29361
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1961 static void
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1962 pidgin_custom_font_set(GtkWidget *font_button, PidginPrefsWindow *win)
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1963 {
29361
c73b60e914bb Make the conversation text preview section dynamically update as the win32-only font override changes. Fixes #11168
Daniel Atallah <datallah@pidgin.im>
parents: 29154
diff changeset
1964
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1965 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/custom_font",
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1966 gtk_font_chooser_get_font(GTK_FONT_CHOOSER(font_button)));
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1967
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1968 apply_custom_font(font_button, win);
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1969 }
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1970
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1971 static void
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1972 bind_conv_page(PidginPrefsWindow *win)
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
1973 {
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1974 GSimpleActionGroup *ag = NULL;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1975
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1976 win->conversations.notification_chat.type = PURPLE_PREF_INT;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1977 win->conversations.notification_chat.key = PIDGIN_PREFS_ROOT "/conversations/notification_chat";
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1978 pidgin_prefs_bind_dropdown(&win->conversations.notification_chat);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1979
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1980 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1981 win->conversations.show_incoming_formatting);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1982 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/im/close_immediately",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1983 win->conversations.im.close_immediately);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1984
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1985 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1986 win->conversations.im.show_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1987 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/im/animate_buddy_icons",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1988 win->conversations.im.animate_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1989 g_object_bind_property(win->conversations.im.show_buddy_icons, "active",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1990 win->conversations.im.animate_buddy_icons, "sensitive",
39173
7adf95ad7b4a Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 39152
diff changeset
1991 G_BINDING_SYNC_CREATE);
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
1992
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1993 pidgin_prefs_bind_checkbox("/purple/conversations/im/send_typing",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1994 win->conversations.im.send_typing);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1995 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/spellcheck",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1996 win->conversations.spellcheck);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1997
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1998 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/conversations/use_smooth_scrolling",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1999 win->conversations.use_smooth_scrolling);
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
2000
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2001 #ifdef _WIN32
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2002 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/win32/blink_im",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2003 win->conversations.win32.blink_im);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2004 #else
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2005 gtk_widget_hide(win->conversations.win32.blink_im);
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
2006 #endif
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
2007
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
2008 #if 0
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
2009 /* TODO: it's not implemented */
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2010 pidgin_prefs_bind_checkbox(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2011 PIDGIN_PREFS_ROOT "/conversations/resize_custom_smileys",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2012 win->conversations.resize_custom_smileys);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2013
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2014 pidgin_prefs_bind_spin_button(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2015 PIDGIN_PREFS_ROOT "/conversations/custom_smileys_size",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2016 win->conversations.custom_smileys_size);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2017
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2018 g_object_bind_property(win->conversations.resize_custom_smileys, "active",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2019 win->conversations.custom_smileys_size, "sensitive",
39173
7adf95ad7b4a Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 39152
diff changeset
2020 G_BINDING_SYNC_CREATE);
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
2021 #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
2022
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2023 pidgin_prefs_bind_spin_button(
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
2024 PIDGIN_PREFS_ROOT "/conversations/minimum_entry_lines",
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2025 win->conversations.minimum_entry_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
2026
29656
2dfea274d539 Fix the Windows font pref for the new GTK version requirements.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 29655
diff changeset
2027 #ifdef _WIN32
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
2028 {
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
2029 const char *font_name;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2030 gtk_widget_show(win->conversations.font_frame);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2031
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2032 pidgin_prefs_bind_checkbox(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2033 PIDGIN_PREFS_ROOT "/conversations/use_theme_font",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2034 win->conversations.use_theme_font);
28908
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
2035
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
2036 font_name = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font");
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2037 if (font_name != NULL && *font_name != '\0') {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2038 gtk_font_chooser_set_font(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2039 GTK_FONT_CHOOSER(win->conversations.custom_font),
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2040 font_name);
28908
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
2041 }
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
2042
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2043 g_object_bind_property(win->conversations.use_theme_font, "active",
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2044 win->conversations.custom_font_hbox, "sensitive",
39173
7adf95ad7b4a Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 39152
diff changeset
2045 G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
2046 }
28908
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
2047 #endif
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
2048
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
2049 ag = talkatu_buffer_get_action_group(TALKATU_BUFFER(win->conversations.format_buffer));
39264
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
2050 g_signal_connect_after(G_OBJECT(ag), "action-activated",
34274
9169710b5af5 Hide GtkWebViewToolbar stuff within the GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34259
diff changeset
2051 G_CALLBACK(formatting_toggle_cb), 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
2052 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2053
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2054 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2055 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
2056 {
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
2057 const gchar *text = gtk_entry_get_text(entry);
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2058 GtkStyleContext *context = gtk_widget_get_style_context(GTK_WIDGET(entry));
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
2059
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
2060 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
2061 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
2062 purple_network_set_public_ip(text);
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2063 gtk_style_context_add_class(context, "good-ip");
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2064 gtk_style_context_remove_class(context, "bad-ip");
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
2065 } else {
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2066 gtk_style_context_add_class(context, "bad-ip");
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2067 gtk_style_context_remove_class(context, "good-ip");
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
2068 }
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
2069
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
2070 } 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
2071 purple_network_set_public_ip("");
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2072 gtk_style_context_remove_class(context, "bad-ip");
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2073 gtk_style_context_remove_class(context, "good-ip");
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
2074 }
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
2075 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2076
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2077 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2078 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
2079 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
2080 {
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
2081 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
2082 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
2083 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
2084 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
2085
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
2086 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
2087 }
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
2088
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2089 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2090 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
2091 GdkEventFocus *event, gpointer data)
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2092 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2093 GtkEntry *entry = GTK_ENTRY(widget);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2094 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
2095 gtk_entry_get_text(entry));
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2096 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
2097
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2098 return FALSE;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2099 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2100
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
2101 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
2102 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
2103 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
2104 {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2105 PidginPrefsWindow *win = 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
2106 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
2107
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
2108 if (!purple_strequal(proxy, "none") && !purple_strequal(proxy, "envvar"))
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2109 gtk_widget_show_all(win->proxy.options);
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
2110 else
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2111 gtk_widget_hide(win->proxy.options);
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
2112 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2113
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2114 static void
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2115 proxy_print_option(GtkWidget *entry, PidginPrefsWindow *win)
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
2116 {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2117 if (entry == win->proxy.host) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2118 purple_prefs_set_string("/purple/proxy/host",
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2119 gtk_entry_get_text(GTK_ENTRY(entry)));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2120 } else if (entry == win->proxy.port) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2121 purple_prefs_set_int("/purple/proxy/port",
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2122 gtk_spin_button_get_value_as_int(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2123 GTK_SPIN_BUTTON(entry)));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2124 } else if (entry == win->proxy.username) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2125 purple_prefs_set_string("/purple/proxy/username",
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2126 gtk_entry_get_text(GTK_ENTRY(entry)));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2127 } else if (entry == win->proxy.password) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2128 purple_prefs_set_string("/purple/proxy/password",
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2129 gtk_entry_get_text(GTK_ENTRY(entry)));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2130 }
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
2131 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2132
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2133 static void
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2134 proxy_button_clicked_cb(GtkWidget *button, PidginPrefsWindow *win)
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
2135 {
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 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
2137
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2138 if (g_spawn_command_line_async(win->proxy.gnome_program_path, &err))
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
2139 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
2140
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2141 purple_notify_error(NULL, NULL, _("Cannot start proxy configuration program."), err->message, 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
2142 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
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
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2146 browser_button_clicked_cb(GtkWidget *button, PidginPrefsWindow *win)
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
2147 {
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 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
2149
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2150 if (g_spawn_command_line_async(win->browser.gnome_program_path, &err))
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
2151 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
2152
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2153 purple_notify_error(NULL, NULL, _("Cannot start browser configuration program."), err->message, 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
2154 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
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
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
2157 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
2158 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
2159 {
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
2160 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
2161 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
2162 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
2163
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
2164 /* 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
2165 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
2166 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
2167
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
2168 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
2169 /* 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
2170 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
2171 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
2172 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
2173 } 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
2174 /* 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
2175 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
2176 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
2177 /* 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
2178 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
2179 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
2180 /* 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
2181 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
2182 }
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
2183 }
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
2184 }
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
2185 }
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
2186 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
2187 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
2188
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
2189 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
2190 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
2191 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
2192 }
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
2193
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2194 static void
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2195 bind_network_page(PidginPrefsWindow *win)
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
2196 {
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2197 GtkStyleContext *context;
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2198 GtkCssProvider *ip_css;
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2199 const gchar ip_style[] =
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2200 ".bad-ip {"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2201 "color: @error_fg_color;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2202 "text-shadow: 0 1px @error_text_shadow;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2203 "background-image: none;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2204 "background-color: @error_bg_color;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2205 "}"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2206 ".good-ip {"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2207 "color: @question_fg_color;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2208 "text-shadow: 0 1px @question_text_shadow;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2209 "background-image: none;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2210 "background-color: @success_color;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2211 "}";
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
2212
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2213 gtk_entry_set_text(GTK_ENTRY(win->network.stun_server),
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2214 purple_prefs_get_string("/purple/network/stun_server"));
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2215
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2216 pidgin_prefs_bind_checkbox("/purple/network/auto_ip",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2217 win->network.auto_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2218 auto_ip_button_clicked_cb(win->network.auto_ip, NULL); /* Update label */
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2219
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2220 gtk_entry_set_text(GTK_ENTRY(win->network.public_ip),
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2221 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
2222
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2223 ip_css = gtk_css_provider_new();
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2224 gtk_css_provider_load_from_data(ip_css, ip_style, -1, NULL);
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2225 context = gtk_widget_get_style_context(win->network.public_ip);
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2226 gtk_style_context_add_provider(context,
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2227 GTK_STYLE_PROVIDER(ip_css),
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2228 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2229
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2230 g_object_bind_property(win->network.auto_ip, "active",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2231 win->network.public_ip_hbox, "sensitive",
39173
7adf95ad7b4a Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 39152
diff changeset
2232 G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
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
2233
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2234 pidgin_prefs_bind_checkbox("/purple/network/map_ports",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2235 win->network.map_ports);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2236
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2237 pidgin_prefs_bind_checkbox("/purple/network/ports_range_use",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2238 win->network.ports_range_use);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2239 g_object_bind_property(win->network.ports_range_use, "active",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2240 win->network.ports_range_hbox, "sensitive",
39173
7adf95ad7b4a Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 39152
diff changeset
2241 G_BINDING_SYNC_CREATE);
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
2242
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2243 pidgin_prefs_bind_spin_button("/purple/network/ports_range_start",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2244 win->network.ports_range_start);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2245 pidgin_prefs_bind_spin_button("/purple/network/ports_range_end",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2246 win->network.ports_range_end);
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2247
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2248 /* TURN server */
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2249 gtk_entry_set_text(GTK_ENTRY(win->network.turn_server),
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2250 purple_prefs_get_string("/purple/network/turn_server"));
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2251
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2252 pidgin_prefs_bind_spin_button("/purple/network/turn_port",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2253 win->network.turn_port_udp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2254
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2255 pidgin_prefs_bind_spin_button("/purple/network/turn_port_tcp",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2256 win->network.turn_port_tcp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2257
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2258 pidgin_prefs_bind_entry("/purple/network/turn_username",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2259 win->network.turn_username);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2260 pidgin_prefs_bind_entry("/purple/network/turn_password",
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2261 win->network.turn_password);
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
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2264 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2265 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
2266 {
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
2267 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
2268
30812
77e8d4906cfe I thought I had done this in my last commit. Clearly I'm an idiot. This fixes
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30810
diff changeset
2269 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", program);
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
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 /* 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
2272 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
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
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2275 #ifndef _WIN32
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2276 static GList *
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2277 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
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 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
2280 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
2281 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
2282 };
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 /* 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
2285 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
2286 {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
2287 {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
2288 {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
2289 {N_("Konqueror"), "kfmclient"},
30798
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2290 {N_("Google Chrome"), "google-chrome"},
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2291 /* Do not move the line below. Code below expects gnome-open to be in
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2292 * this list immediately after xdg-open! */
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
2293 {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
2294 {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
2295 {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
2296 {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
2297 {N_("Firebird"), "mozilla-firebird"},
30798
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2298 {N_("Epiphany"), "epiphany"},
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2299 /* Translators: please do not translate "chromium-browser" here! */
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2300 {N_("Chromium (chromium-browser)"), "chromium-browser"},
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2301 /* Translators: please do not translate "chrome" here! */
2f8ba31e529c Modernize the list of browsers a bit by adding Google Chrome and Chromium to
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30743
diff changeset
2302 {N_("Chromium (chrome)"), "chrome"}
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 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
2305
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 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
2307 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
2308 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
2309
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2310 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
2311 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
2312
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2313 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
2314 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
2315 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
2316 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
2317 browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name));
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
2318 if(browser_setting && purple_strequal(possible_browsers[i].command, browser_setting))
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
2319 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
2320 /* If xdg-open is valid, prefer it over gnome-open and skip forward */
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
2321 if(purple_strequal(possible_browsers[i].command, "xdg-open")) {
38260
dcada91c0912 Remove redundant NULL checks
qarkai <qarkai@gmail.com>
parents: 38259
diff changeset
2322 if (purple_strequal("gnome-open", browser_setting)) {
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
2323 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
2324 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
2325 }
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 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
2327 }
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 }
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 }
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
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2331 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
2332 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
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 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
2335 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2336
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2337 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
2338 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
2339 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
2340 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2341 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
2342 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
2343
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
2344 gtk_widget_set_sensitive(hbox, !purple_strequal(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
2345 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2346
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2347 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
2348 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
2349 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
2350 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2351 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
2352 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
2353
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
2354 gtk_widget_set_sensitive(hbox, purple_strequal(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
2355 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2356
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2357 static void
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2358 bind_browser_page(PidginPrefsWindow *win)
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 {
32093
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2360 if (purple_running_gnome()) {
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2361 gchar *path;
28894
ce2f7d76f26d Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28893
diff changeset
2362
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2363 gtk_stack_set_visible_child_name(GTK_STACK(win->browser.stack),
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2364 "gnome");
28894
ce2f7d76f26d Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28893
diff changeset
2365
32093
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2366 path = g_find_program_in_path("gnome-control-center");
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2367 if (path != NULL) {
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2368 gchar *tmp = g_strdup_printf("%s info", path);
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2369 g_free(path);
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2370 path = tmp;
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2371 } else {
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2372 path = g_find_program_in_path("gnome-default-applications-properties");
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2373 }
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2374
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2375 win->browser.gnome_program_path = path;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2376 gtk_widget_set_visible(win->browser.gnome_not_found,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2377 path == NULL);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2378 gtk_widget_set_visible(win->browser.gnome_program,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2379 path != 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
2380 } else {
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2381 GList *browsers = NULL;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2382
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2383 gtk_stack_set_visible_child_name(GTK_STACK(win->browser.stack),
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2384 "nongnome");
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2385
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2386 win->browser.browser.type = PURPLE_PREF_STRING;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2387 win->browser.browser.key = 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
2388 browsers = get_available_browsers();
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2389 pidgin_prefs_bind_dropdown_from_list(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2390 &win->browser.browser,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2391 browsers);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2392 g_list_free(browsers);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2393
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2394 win->browser.place.type = PURPLE_PREF_INT;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2395 win->browser.place.key = PIDGIN_PREFS_ROOT "/browsers/place";
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2396 pidgin_prefs_bind_dropdown(&win->browser.place);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2397
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2398 purple_prefs_connect_callback(prefs,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2399 PIDGIN_PREFS_ROOT "/browsers/browser",
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2400 browser_changed1_cb,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2401 win->browser.place_hbox);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2402
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2403 gtk_entry_set_text(GTK_ENTRY(win->browser.manual_command),
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2404 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/manual_command"));
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2405 purple_prefs_connect_callback(prefs,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2406 PIDGIN_PREFS_ROOT "/browsers/browser",
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2407 browser_changed2_cb,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2408 win->browser.manual_command_hbox);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2409
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2410 if (purple_strequal(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2411 purple_prefs_get_string(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2412 PIDGIN_PREFS_ROOT "/browsers/browser"),
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2413 "custom")) {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2414 gtk_widget_set_sensitive(win->browser.place_hbox,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2415 FALSE);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2416 } else {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2417 gtk_widget_set_sensitive(win->browser.manual_command_hbox,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2418 FALSE);
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
2419 }
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
2420 }
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 }
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 #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
2423
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2424 static void
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2425 bind_proxy_page(PidginPrefsWindow *win)
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2426 {
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2427 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
2428
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
2429 if(purple_running_gnome()) {
28905
618681644b97 In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28904
diff changeset
2430 gchar *path = NULL;
28894
ce2f7d76f26d Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28893
diff changeset
2431
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2432 gtk_stack_set_visible_child_name(GTK_STACK(win->proxy.stack),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2433 "gnome");
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
2434
28905
618681644b97 In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28904
diff changeset
2435 path = g_find_program_in_path("gnome-network-properties");
618681644b97 In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28904
diff changeset
2436 if (path == NULL)
618681644b97 In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28904
diff changeset
2437 path = g_find_program_in_path("gnome-network-preferences");
32079
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2438 if (path == NULL) {
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2439 path = g_find_program_in_path("gnome-control-center");
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2440 if (path != NULL) {
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2441 char *tmp = g_strdup_printf("%s network", path);
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2442 g_free(path);
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2443 path = tmp;
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2444 }
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2445 }
28905
618681644b97 In GNOME 2.26, the program gnome-network-preferences was renamed to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28904
diff changeset
2446
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2447 win->proxy.gnome_program_path = path;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2448 gtk_widget_set_visible(win->proxy.gnome_not_found,
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2449 path == NULL);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2450 gtk_widget_set_visible(win->proxy.gnome_program,
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2451 path != 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
2452 } else {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2453 gtk_stack_set_visible_child_name(GTK_STACK(win->proxy.stack),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2454 "nongnome");
28920
e38df78447aa Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <datallah@pidgin.im>
parents: 28919
diff changeset
2455
28891
6502040769d4 Silence some assertions QuLogic noticed.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28890
diff changeset
2456 /* 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
2457 * account-specific proxy settings */
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2458 pidgin_prefs_bind_checkbox("/purple/proxy/socks4_remotedns",
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2459 win->proxy.socks4_remotedns);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2460
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2461 win->proxy.type.type = PURPLE_PREF_STRING;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2462 win->proxy.type.key = "/purple/proxy/type";
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2463 pidgin_prefs_bind_dropdown(&win->proxy.type);
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
2464 proxy_info = purple_global_proxy_get_info();
28920
e38df78447aa Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <datallah@pidgin.im>
parents: 28919
diff changeset
2465
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
2466 purple_prefs_connect_callback(prefs, "/purple/proxy/type",
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2467 proxy_changed_cb, win);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2468
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2469 if (proxy_info != NULL) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2470 if (purple_proxy_info_get_host(proxy_info)) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2471 gtk_entry_set_text(GTK_ENTRY(win->proxy.host),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2472 purple_proxy_info_get_host(proxy_info));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2473 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2474
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2475 if (purple_proxy_info_get_port(proxy_info) != 0) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2476 gtk_spin_button_set_value(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2477 GTK_SPIN_BUTTON(win->proxy.port),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2478 purple_proxy_info_get_port(proxy_info));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2479 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2480
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2481 if (purple_proxy_info_get_username(proxy_info) != NULL) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2482 gtk_entry_set_text(GTK_ENTRY(win->proxy.username),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2483 purple_proxy_info_get_username(proxy_info));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2484 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2485
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2486 if (purple_proxy_info_get_password(proxy_info) != NULL) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2487 gtk_entry_set_text(GTK_ENTRY(win->proxy.password),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2488 purple_proxy_info_get_password(proxy_info));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2489 }
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
2490 }
28920
e38df78447aa Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <datallah@pidgin.im>
parents: 28919
diff changeset
2491
e38df78447aa Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <datallah@pidgin.im>
parents: 28919
diff changeset
2492 proxy_changed_cb("/purple/proxy/type", PURPLE_PREF_STRING,
e38df78447aa Fix the proxy configuration fields to appear as appropriate for the current proxy selection. Also reduce the scope on the proxy frame variables.
Daniel Atallah <datallah@pidgin.im>
parents: 28919
diff changeset
2493 purple_prefs_get_string("/purple/proxy/type"),
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2494 win);
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2495 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2496 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2497
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2498 static void
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2499 bind_logging_page(PidginPrefsWindow *win)
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
2500 {
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 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
2502
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2503 win->logging.format.type = PURPLE_PREF_STRING;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2504 win->logging.format.key = "/purple/logging/format";
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
2505 names = purple_log_logger_get_options();
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2506 pidgin_prefs_bind_dropdown_from_list(&win->logging.format, names);
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
2507 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
2508
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2509 pidgin_prefs_bind_checkbox("/purple/logging/log_ims",
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2510 win->logging.log_ims);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2511 pidgin_prefs_bind_checkbox("/purple/logging/log_chats",
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2512 win->logging.log_chats);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2513 pidgin_prefs_bind_checkbox("/purple/logging/log_system",
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2514 win->logging.log_system);
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
2515 }
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
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2517 /*** keyring page *******************************************************/
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2518
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2519 static void
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2520 keyring_page_settings_changed(GtkWidget *widget, gpointer _setting)
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2521 {
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2522 PurpleRequestField *setting = _setting;
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2523 PurpleRequestFieldType field_type;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2524
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2525 gtk_widget_set_sensitive(keyring_apply, TRUE);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2526
35378
5d9e2581005b gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents: 35106
diff changeset
2527 field_type = purple_request_field_get_field_type(setting);
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2528
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2529 if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2530 purple_request_field_bool_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2531 gtk_toggle_button_get_active(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2532 GTK_TOGGLE_BUTTON(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2533 } else if (field_type == PURPLE_REQUEST_FIELD_STRING) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2534 purple_request_field_string_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2535 gtk_entry_get_text(GTK_ENTRY(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2536 } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2537 purple_request_field_int_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2538 gtk_spin_button_get_value_as_int(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2539 GTK_SPIN_BUTTON(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2540 } else
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2541 g_return_if_reached();
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2542 }
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2543
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2544 static GtkWidget *
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2545 keyring_page_add_settings_field(GtkBox *vbox, PurpleRequestField *setting,
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2546 GtkSizeGroup *sg)
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2547 {
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2548 GtkWidget *widget, *hbox;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2549 PurpleRequestFieldType field_type;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2550 const gchar *label;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2551
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2552 label = purple_request_field_get_label(setting);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2553
35378
5d9e2581005b gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents: 35106
diff changeset
2554 field_type = purple_request_field_get_field_type(setting);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2555 if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2556 widget = gtk_check_button_new_with_label(label);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2557 label = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2558 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2559 purple_request_field_bool_get_value(setting));
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2560 g_signal_connect(G_OBJECT(widget), "toggled",
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2561 G_CALLBACK(keyring_page_settings_changed), setting);
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2562 } else if (field_type == PURPLE_REQUEST_FIELD_STRING) {
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2563 widget = gtk_entry_new();
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2564 gtk_entry_set_text(GTK_ENTRY(widget),
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2565 purple_request_field_string_get_value(setting));
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2566 if (purple_request_field_string_is_masked(setting))
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2567 gtk_entry_set_visibility(GTK_ENTRY(widget), FALSE);
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2568 g_signal_connect(G_OBJECT(widget), "changed",
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2569 G_CALLBACK(keyring_page_settings_changed), setting);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2570 } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2571 widget = gtk_spin_button_new_with_range(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2572 purple_request_field_int_get_lower_bound(setting),
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2573 purple_request_field_int_get_upper_bound(setting), 1);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2574 gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2575 purple_request_field_int_get_value(setting));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2576 g_signal_connect(G_OBJECT(widget), "value-changed",
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2577 G_CALLBACK(keyring_page_settings_changed), setting);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2578 } else {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2579 purple_debug_error("gtkprefs", "Unsupported field type\n");
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2580 return NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2581 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2582
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2583 hbox = pidgin_add_widget_to_vbox(vbox, label, sg, widget,
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2584 FALSE, NULL);
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2585 return ((void*)hbox == (void*)vbox) ? widget : hbox;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2586 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2587
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2588 /* XXX: it could be available for all plugins, not keyrings only */
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2589 static GList *
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2590 keyring_page_add_settings(PurpleRequestFields *settings)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2591 {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2592 GList *it, *groups, *added_fields;
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2593 GtkSizeGroup *sg;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2594
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2595 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2596
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2597 added_fields = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2598 groups = purple_request_fields_get_groups(settings);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2599 for (it = g_list_first(groups); it != NULL; it = g_list_next(it)) {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2600 GList *it2, *fields;
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2601 GtkBox *vbox;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2602 PurpleRequestFieldGroup *group;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2603 const gchar *group_title;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2604
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2605 group = it->data;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2606 group_title = purple_request_field_group_get_title(group);
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2607 if (group_title) {
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2608 vbox = GTK_BOX(pidgin_make_frame(
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2609 GTK_WIDGET(keyring_vbox), group_title));
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2610 added_fields = g_list_prepend(added_fields,
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2611 g_object_get_data(G_OBJECT(vbox), "main-vbox"));
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2612 } else
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2613 vbox = keyring_vbox;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2614
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2615 fields = purple_request_field_group_get_fields(group);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2616 for (it2 = g_list_first(fields); it2 != NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2617 it2 = g_list_next(it2)) {
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2618 GtkWidget *added = keyring_page_add_settings_field(vbox,
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2619 it2->data, sg);
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2620 if (added == NULL || vbox != keyring_vbox)
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2621 continue;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2622 added_fields = g_list_prepend(added_fields, added);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2623 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2624 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2625
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2626 g_object_unref(sg);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2627
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2628 return added_fields;
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2629 }
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2630
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2631 static void
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2632 keyring_page_settings_apply(GtkButton *button, gpointer _unused)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2633 {
34188
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
2634 if (!purple_keyring_apply_settings(prefs, keyring_settings))
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2635 return;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2636
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2637 gtk_widget_set_sensitive(keyring_apply, FALSE);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2638 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2639
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2640 static void
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2641 keyring_page_update_settings()
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2642 {
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2643 if (keyring_settings != NULL)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2644 purple_request_fields_destroy(keyring_settings);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2645 keyring_settings = purple_keyring_read_settings();
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2646 if (!keyring_settings)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2647 return;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2648
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2649 keyring_settings_fields = keyring_page_add_settings(keyring_settings);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2650
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2651 keyring_apply = gtk_button_new_with_mnemonic(_("_Apply"));
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2652 gtk_box_pack_start(keyring_vbox, keyring_apply, FALSE, FALSE, 1);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2653 gtk_widget_set_sensitive(keyring_apply, FALSE);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2654 keyring_settings_fields = g_list_prepend(keyring_settings_fields,
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2655 keyring_apply);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2656 g_signal_connect(G_OBJECT(keyring_apply), "clicked",
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2657 G_CALLBACK(keyring_page_settings_apply), NULL);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2658
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2659 gtk_widget_show_all(keyring_page_instance);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2660 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2661
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2662 static void
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2663 keyring_page_pref_set_inuse(GError *error, gpointer _keyring_page_instance)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2664 {
34155
567c48f9658c Refactor the keyring API
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34151
diff changeset
2665 PurpleKeyring *in_use = purple_keyring_get_inuse();
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2666
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2667 if (_keyring_page_instance != keyring_page_instance) {
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2668 purple_debug_info("gtkprefs", "pref window already closed\n");
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2669 return;
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2670 }
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2671
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2672 gtk_widget_set_sensitive(GTK_WIDGET(keyring_combo), TRUE);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2673
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2674 if (error != NULL) {
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2675 pidgin_prefs_dropdown_revert_active(keyring_combo);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2676 purple_notify_error(NULL, _("Keyring"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2677 _("Failed to set new keyring"), error->message, NULL);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2678 return;
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2679 }
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2680
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2681 g_return_if_fail(in_use != NULL);
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2682 purple_prefs_set_string("/purple/keyring/active",
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2683 purple_keyring_get_id(in_use));
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2684
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2685 keyring_page_update_settings();
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2686 }
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2687
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2688 static void
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
2689 keyring_page_pref_changed(GtkComboBox *combo_box, PidginPrefValue value)
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2690 {
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2691 const char *keyring_id;
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34023
diff changeset
2692 PurpleKeyring *keyring;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2693 GList *it;
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2694
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2695 g_return_if_fail(combo_box != NULL);
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2696 g_return_if_fail(value.type == PURPLE_PREF_STRING);
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2697
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2698 keyring_id = value.value.string;
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2699 keyring = purple_keyring_find_keyring_by_id(keyring_id);
34120
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2700 if (keyring == NULL) {
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2701 pidgin_prefs_dropdown_revert_active(keyring_combo);
34120
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2702 purple_notify_error(NULL, _("Keyring"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2703 _("Selected keyring is disabled"), NULL, NULL);
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2704 return;
34120
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2705 }
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2706
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2707 gtk_widget_set_sensitive(GTK_WIDGET(combo_box), FALSE);
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2708
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2709 for (it = keyring_settings_fields; it != NULL; it = g_list_next(it))
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2710 {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2711 GtkWidget *widget = it->data;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2712 gtk_container_remove(
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2713 GTK_CONTAINER(gtk_widget_get_parent(widget)), widget);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2714 }
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2715 gtk_widget_show_all(keyring_page_instance);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2716 g_list_free(keyring_settings_fields);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2717 keyring_settings_fields = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2718 if (keyring_settings)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2719 purple_request_fields_destroy(keyring_settings);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2720 keyring_settings = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2721
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2722 purple_keyring_set_inuse(keyring, FALSE, keyring_page_pref_set_inuse,
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2723 keyring_page_instance);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2724 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2725
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2726 static void
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2727 keyring_page_cleanup(void)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2728 {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2729 keyring_page_instance = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2730 keyring_combo = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2731 keyring_vbox = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2732 g_list_free(keyring_settings_fields);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2733 keyring_settings_fields = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2734 if (keyring_settings)
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2735 purple_request_fields_destroy(keyring_settings);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2736 keyring_settings = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2737 keyring_apply = NULL;
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2738 }
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2739
33983
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2740 static GtkWidget *
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2741 keyring_page(void)
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2742 {
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2743 GList *names;
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2744 PidginPrefValue initial;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2745
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2746 g_return_val_if_fail(keyring_page_instance == NULL,
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2747 keyring_page_instance);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2748
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
2749 keyring_page_instance = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_CAT_SPACE);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2750 gtk_container_set_border_width(GTK_CONTAINER(keyring_page_instance),
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2751 PIDGIN_HIG_BORDER);
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2752
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2753 /* Keyring selection */
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2754 keyring_vbox = GTK_BOX(pidgin_make_frame(keyring_page_instance,
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2755 _("Keyring")));
33983
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2756 names = purple_keyring_get_options();
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2757 initial.type = PURPLE_PREF_STRING;
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2758 initial.value.string = purple_prefs_get_string("/purple/keyring/active");
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2759 pidgin_prefs_dropdown_from_list_with_cb(GTK_WIDGET(keyring_vbox),
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2760 _("Keyring:"), &keyring_combo, names, initial,
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2761 keyring_page_pref_changed);
33983
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2762 g_list_free(names);
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2763
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2764 keyring_page_update_settings();
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2765
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2766 gtk_widget_show_all(keyring_page_instance);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2767
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2768 return keyring_page_instance;
33983
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2769 }
317cd0a252c2 Fixed a bunch of bugs/errors, worked on making calls async, on configuration UI, and on Makefiles.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 23261
diff changeset
2770
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2771 /*** keyring page - end *************************************************/
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2772
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2773 static gint
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2774 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
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 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
2777 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
2778 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
2779 }
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 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
2782 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
2783 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
2784 {
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 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
2786 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
2787
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
2788 gtk_widget_set_sensitive(hbox, purple_strequal(method, "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
2789 }
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
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 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
2792 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
2793 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
2794 {
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 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
2796 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
2797
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
2798 gtk_widget_set_sensitive(vbox, !purple_strequal(method, "none"));
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
2799 }
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
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
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2802 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
2803 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
2804 {
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 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
2806 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
2807 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
2808 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
2809
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 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
2811 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
2812 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
2813 -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
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 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
2816 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
2817
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 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
2819 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
2820 -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
2821
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 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
2823 }
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
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 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
2826 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
2827 {
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 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
2829 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
2830 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
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 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
2833 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
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 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
2836 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
2837
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 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
2839 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
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 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
2842
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 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
2844 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
2845
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 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
2847 }
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
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 /*
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 * 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
2851 */
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 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
2853 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
2854 {
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 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
2856
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 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
2858 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
2859 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
2860 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
2861
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 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
2863
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
2864 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
2865 }
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
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 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
2868 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
2869 {
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 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
2871 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
2872
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 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
2874
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 /* 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
2876 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
2877 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
2878 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
2879 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
2880
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 * 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
2883 * 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
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 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
2886 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
2887
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
2888 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
2889 }
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
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2891 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2892 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
2893 {
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 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
2895 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
2896
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 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
2898 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
2899 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
2900 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
2901
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2902 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
2903 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
2904
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2905 purple_request_file(prefs, _("Sound Selection"), filename, FALSE,
34333
b92698241603 Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34308
diff changeset
2906 G_CALLBACK(sound_chosen_cb), NULL, NULL,
b92698241603 Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34308
diff changeset
2907 GINT_TO_POINTER(sound_row_sel));
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
2908 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2909
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2910 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2911 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
2912 {
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
2913 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
2914 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
2915 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
2916 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
2917
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2918 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
2919 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
2920
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2921 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
2922 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
2923 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
2924
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2925 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
2926 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
2927 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
2928 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
2929 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
2930 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
2931 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
2932
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
2933 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
2934 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2935
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2936
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2937 static void
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2938 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
2939 PurplePrefType pref_type,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2940 gconstpointer val,
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2941 gpointer data)
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2942 {
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2943 GtkToggleButton *button = data;
24533
37232ecf7246 Fix some warnings:
Richard Laager <rlaager@pidgin.im>
parents: 24284
diff changeset
2944 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
2945
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
2946 g_return_if_fail(purple_strequal (pref_name, PIDGIN_PREFS_ROOT "/sound/mute"));
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2947
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2948 /* Block the handler that re-sets the preference. */
24533
37232ecf7246 Fix some warnings:
Richard Laager <rlaager@pidgin.im>
parents: 24284
diff changeset
2949 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
2950 gtk_toggle_button_set_active (button, muted);
24533
37232ecf7246 Fix some warnings:
Richard Laager <rlaager@pidgin.im>
parents: 24284
diff changeset
2951 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
2952 }
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2953
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2954
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
2955 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
2956 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
2957 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2958 GtkWidget *ret;
33896
fb896f14715b win32: fix most of easy warnings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33892
diff changeset
2959 GtkWidget *vbox, *vbox2, *button, *parent, *parent_parent, *parent_parent_parent;
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
2960 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
2961 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
2962 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
2963 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
2964 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
2965 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
2966 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
2967 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
2968 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
2969 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
2970 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
2971 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
2972 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
2973 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
2974 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
2975
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
2976 ret = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_CAT_SPACE);
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
2977 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
2978
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2979 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
2980
28877
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2981 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
2982
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
2983 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_BOX_SPACE);
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
2984 gtk_box_pack_start(GTK_BOX(vbox2), vbox, FALSE, FALSE, 0);
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
2985
28877
1ec9f377bd78 Collapse "Sound Method" and "Sound Options" sections on the Sounds tab into one
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28876
diff changeset
2986 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
2987 PIDGIN_PREFS_ROOT "/sound/method",
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2988 _("Automatic"), "automatic",
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
2989 #ifdef USE_GSTREAMER
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2990 #ifdef _WIN32
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2991 /* "WaveForm", "waveform", */
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2992 "DirectSound", "directsound",
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2993 #else
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
2994 "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
2995 "ALSA", "alsa",
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2996 #endif /* _WIN32 */
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2997 #endif /* USE_GSTREAMER */
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2998 #ifdef _WIN32
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2999 "PlaySound", "playsoundw",
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3000 #else
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3001 _("Console beep"), "beep",
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
3002 _("Command"), "custom",
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3003 #endif /* _WIN32 */
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
3004 _("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
3005 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
3006 gtk_size_group_add_widget(sg, dd);
39179
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
3007 gtk_label_set_xalign(GTK_LABEL(dd), 0.0);
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
3008 gtk_label_set_yalign(GTK_LABEL(dd), 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
3009
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3010 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
3011 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
3012 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
3013 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
3014 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
3015 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
3016 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
3017
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3018 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
3019 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
3020 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
3021 gtk_widget_set_sensitive(hbox,
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
3022 purple_strequal(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"),
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
3023 "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
3024
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
3025 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
3026 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
3027
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
3028 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
3029 PIDGIN_PREFS_ROOT "/sound/conv_focus", vbox);
24268
e725d9fa4cf4 Prefs/Sounds: add some mnemonics
Will Thompson <resiak@pidgin.im>
parents: 24267
diff changeset
3030 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
3031 PURPLE_PREF_INT, "/purple/sound/while_status",
37398
a9aa2aa0b1b6 Replace magic numbers on the sound API
Jorge Villaseñor <salinasv@pidgin.im>
parents: 37158
diff changeset
3032 _("Only when available"), PURPLE_SOUND_STATUS_AVAILABLE,
a9aa2aa0b1b6 Replace magic numbers on the sound API
Jorge Villaseñor <salinasv@pidgin.im>
parents: 37158
diff changeset
3033 _("Only when not available"), PURPLE_SOUND_STATUS_AWAY,
a9aa2aa0b1b6 Replace magic numbers on the sound API
Jorge Villaseñor <salinasv@pidgin.im>
parents: 37158
diff changeset
3034 _("Always"), PURPLE_SOUND_STATUS_ALWAYS,
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
3035 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
3036
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3037 gtk_widget_set_sensitive(vbox,
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
3038 !purple_strequal(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none"));
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
3039 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
3040 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
3041 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
3042
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3043 /* 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
3044 * sound events list is big enough to be usable */
32422
c215bc5d85e4 Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32414
diff changeset
3045 parent = gtk_widget_get_parent(vbox);
c215bc5d85e4 Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32414
diff changeset
3046 parent_parent = gtk_widget_get_parent(parent);
c215bc5d85e4 Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32414
diff changeset
3047 parent_parent_parent = gtk_widget_get_parent(parent_parent);
32394
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 32391
diff changeset
3048 gtk_box_set_child_packing(GTK_BOX(parent), vbox, TRUE, TRUE, 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
3049 GTK_PACK_START);
32394
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 32391
diff changeset
3050 gtk_box_set_child_packing(GTK_BOX(parent_parent),
32422
c215bc5d85e4 Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32414
diff changeset
3051 parent, TRUE, TRUE, 0, GTK_PACK_START);
c215bc5d85e4 Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32414
diff changeset
3052 gtk_box_set_child_packing(GTK_BOX(parent_parent_parent),
32394
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 32391
diff changeset
3053 parent_parent, TRUE, TRUE, 0, GTK_PACK_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
3054
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
3055 /* 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
3056 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
3057
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3058 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
3059 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
3060 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
3061 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
3062
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3063 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
3064 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
3065 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
3066 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3067
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3068 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
3069 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
3070 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
3071 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
3072 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
3073 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
3074 -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
3075 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
3076 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3077
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3078 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
3079
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3080 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
3081 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
3082 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
3083 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
3084 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
3085 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
3086 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
3087 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
3088 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
3089 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
3090
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3091 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
3092 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
3093 "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
3094 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
3095 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
3096
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3097 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
3098 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
3099 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
3100 "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
3101 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
3102 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
3103 g_object_unref(G_OBJECT(event_store));
31321
1fef3832cfa2 Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents: 31294
diff changeset
3104 gtk_box_pack_start(GTK_BOX(vbox),
1fef3832cfa2 Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents: 31294
diff changeset
3105 pidgin_make_scrollable(event_view, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, GTK_SHADOW_IN, -1, 100),
1fef3832cfa2 Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents: 31294
diff changeset
3106 TRUE, TRUE, 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
3107
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
3108 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE);
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
3109 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
3110 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
3111 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
3112 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
3113 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
3114 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
3115 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
3116 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
3117 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
3118
23261
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
3119 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
3120 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
3121 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
3122
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
3123 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
3124 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
3125 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
3126
23261
dd500ffc2cbc Rename and re-order the preference sound buttons to be "Browse...",
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 23151
diff changeset
3127 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
3128 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
3129 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
3130
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3131 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
3132 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
3133
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3134 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
3135 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3136
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3137
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3138 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
3139 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
3140 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3141 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
3142 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3143
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3144 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
3145 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
3146 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3147 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
3148 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3149
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3150 static void
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3151 bind_away_page(PidginPrefsWindow *win)
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
3152 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3153 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
3154
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3155 /* Idle stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3156 win->away.idle_reporting.type = PURPLE_PREF_STRING;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3157 win->away.idle_reporting.key = "/purple/away/idle_reporting";
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3158 pidgin_prefs_bind_dropdown(&win->away.idle_reporting);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3159
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3160 pidgin_prefs_bind_spin_button("/purple/away/mins_before_away",
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3161 win->away.mins_before_away);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3162
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3163 pidgin_prefs_bind_checkbox("/purple/away/away_when_idle",
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3164 win->away.away_when_idle);
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
3165
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3166 /* 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
3167 menu = pidgin_status_menu(purple_savedstatus_get_idleaway(), G_CALLBACK(set_idle_away));
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3168 gtk_widget_show_all(menu);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3169 gtk_box_pack_start(GTK_BOX(win->away.idle_hbox), menu, FALSE, FALSE, 0);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3170
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3171 g_object_bind_property(win->away.away_when_idle, "active",
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3172 menu, "sensitive",
39173
7adf95ad7b4a Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 39152
diff changeset
3173 G_BINDING_SYNC_CREATE);
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
3174
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
3175 /* Away stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3176 win->away.auto_reply.type = PURPLE_PREF_STRING;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3177 win->away.auto_reply.key = "/purple/away/auto_reply";
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3178 pidgin_prefs_bind_dropdown(&win->away.auto_reply);
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
3179
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
3180 /* Signon status stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3181 pidgin_prefs_bind_checkbox("/purple/savedstatus/startup_current_status",
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3182 win->away.startup_current_status);
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
3183
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3184 /* 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
3185 menu = pidgin_status_menu(purple_savedstatus_get_startup(), G_CALLBACK(set_startupstatus));
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3186 gtk_widget_show_all(menu);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3187 gtk_box_pack_start(GTK_BOX(win->away.startup_hbox), menu, FALSE, FALSE, 0);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3188 gtk_label_set_mnemonic_widget(GTK_LABEL(win->away.startup_label), menu);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3189 pidgin_set_accessible_label(menu, GTK_LABEL(win->away.startup_label));
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3190 g_object_bind_property(win->away.startup_current_status, "active",
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3191 win->away.startup_hbox, "sensitive",
39173
7adf95ad7b4a Replace pidgin_toggle_sensitive by g_object_bind_property.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 39152
diff changeset
3192 G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
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
3193 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3194
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
3195 #ifdef USE_VV
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3196 static GList *
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3197 get_vv_device_menuitems(PurpleMediaElementType type)
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3198 {
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3199 GList *result = NULL;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3200 GList *i;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3201
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3202 i = purple_media_manager_enumerate_elements(purple_media_manager_get(),
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3203 type);
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3204 for (; i; i = g_list_delete_link(i, i)) {
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3205 PurpleMediaElementInfo *info = i->data;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3206
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3207 result = g_list_append(result,
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3208 purple_media_element_info_get_name(info));
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3209 result = g_list_append(result,
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3210 purple_media_element_info_get_id(info));
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3211 g_object_unref(info);
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3212 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3213
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3214 return result;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3215 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3216
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3217 static GstElement *
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3218 create_test_element(PurpleMediaElementType type)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3219 {
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3220 PurpleMediaElementInfo *element_info;
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3221
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3222 element_info = purple_media_manager_get_active_element(purple_media_manager_get(), type);
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3223
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3224 g_return_val_if_fail(element_info, NULL);
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3225
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3226 return purple_media_element_info_call_create(element_info,
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3227 NULL, NULL, NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3228 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3229
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3230 static void
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3231 vv_test_switch_page_cb(GtkNotebook *notebook, GtkWidget *page, guint num, gpointer data)
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3232 {
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3233 GtkWidget *test = data;
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3234 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(test), FALSE);
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3235 }
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3236
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3237 static GstElement *
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3238 create_voice_pipeline(void)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3239 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3240 GstElement *pipeline;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3241 GstElement *src, *sink;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3242 GstElement *volume;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3243 GstElement *level;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3244 GstElement *valve;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3245
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3246 pipeline = gst_pipeline_new("voicetest");
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3247
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3248 src = create_test_element(PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SRC);
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3249 sink = create_test_element(PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SINK);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3250 volume = gst_element_factory_make("volume", "volume");
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3251 level = gst_element_factory_make("level", "level");
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3252 valve = gst_element_factory_make("valve", "valve");
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3253
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3254 gst_bin_add_many(GST_BIN(pipeline), src, volume, level, valve, sink, NULL);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3255 gst_element_link_many(src, volume, level, valve, sink, NULL);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3256
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3257 purple_debug_info("gtkprefs", "create_voice_pipeline: setting pipeline "
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3258 "state to GST_STATE_PLAYING - it may hang here on win32\n");
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3259 gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3260 purple_debug_info("gtkprefs", "create_voice_pipeline: state is set\n");
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3261
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3262 return pipeline;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3263 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3264
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3265 static void
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3266 on_volume_change_cb(GtkWidget *w, gdouble value, gpointer data)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3267 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3268 GstElement *volume;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3269
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3270 if (!voice_pipeline)
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3271 return;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3272
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3273 volume = gst_bin_get_by_name(GST_BIN(voice_pipeline), "volume");
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3274 g_object_set(volume, "volume",
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3275 gtk_scale_button_get_value(GTK_SCALE_BUTTON(w)) * 10.0, NULL);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3276 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3277
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3278 static gdouble
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3279 gst_msg_db_to_percent(GstMessage *msg, gchar *value_name)
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3280 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3281 const GValue *list;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3282 const GValue *value;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3283 gdouble value_db;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3284 gdouble percent;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3285
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3286 list = gst_structure_get_value(gst_message_get_structure(msg), value_name);
33509
60647bc63acc Bump GStreamer checks to 1.0.0 instead of 0.11.0.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33508
diff changeset
3287 #if GST_CHECK_VERSION(1,0,0)
33838
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33727
diff changeset
3288 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3289 value = g_value_array_get_nth(g_value_get_boxed(list), 0);
33838
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33727
diff changeset
3290 G_GNUC_END_IGNORE_DEPRECATIONS
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3291 #else
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3292 value = gst_value_list_get_value(list, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3293 #endif
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3294 value_db = g_value_get_double(value);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3295 percent = pow(10, value_db / 20);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3296 return (percent > 1.0) ? 1.0 : percent;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3297 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3298
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3299 static gboolean
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3300 gst_bus_cb(GstBus *bus, GstMessage *msg, gpointer data)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3301 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3302 if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ELEMENT &&
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3303 gst_structure_has_name(gst_message_get_structure(msg), "level")) {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3304
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3305 GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3306 gchar *name = gst_element_get_name(src);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3307
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
3308 if (purple_strequal(name, "level")) {
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3309 gdouble percent;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3310 gdouble threshold;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3311 GstElement *valve;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3312
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3313 percent = gst_msg_db_to_percent(msg, "rms");
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3314 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(voice_level), percent);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3315
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3316 percent = gst_msg_db_to_percent(msg, "decay");
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3317 threshold = gtk_range_get_value(GTK_RANGE(voice_threshold)) / 100.0;
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3318 valve = gst_bin_get_by_name(GST_BIN(GST_ELEMENT_PARENT(src)), "valve");
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3319 g_object_set(valve, "drop", (percent < threshold), NULL);
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3320 g_object_set(voice_level, "text",
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3321 (percent < threshold) ? _("DROP") : " ", NULL);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3322 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3323
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3324 g_free(name);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3325 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3326
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3327 return TRUE;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3328 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3329
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3330 static void
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3331 voice_test_destroy_cb(GtkWidget *w, gpointer data)
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3332 {
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3333 if (!voice_pipeline)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3334 return;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3335
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3336 gst_element_set_state(voice_pipeline, GST_STATE_NULL);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3337 gst_object_unref(voice_pipeline);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3338 voice_pipeline = NULL;
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3339 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3340
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3341 static void
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3342 enable_voice_test(void)
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3343 {
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3344 GstBus *bus;
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3345
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3346 voice_pipeline = create_voice_pipeline();
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3347 bus = gst_pipeline_get_bus(GST_PIPELINE(voice_pipeline));
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3348 gst_bus_add_signal_watch(bus);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3349 g_signal_connect(bus, "message", G_CALLBACK(gst_bus_cb), NULL);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3350 gst_object_unref(bus);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3351 }
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3352
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3353 static void
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3354 toggle_voice_test_cb(GtkToggleButton *test, gpointer data)
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3355 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3356 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3357
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3358 if (gtk_toggle_button_get_active(test)) {
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3359 gtk_widget_set_sensitive(voice_level, TRUE);
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3360 enable_voice_test();
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3361
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3362 g_signal_connect(voice_volume, "value-changed",
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3363 G_CALLBACK(on_volume_change_cb), NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3364 g_signal_connect(test, "destroy",
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3365 G_CALLBACK(voice_test_destroy_cb), NULL);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3366 g_signal_connect(win->notebook, "switch-page",
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3367 G_CALLBACK(vv_test_switch_page_cb), test);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3368 } else {
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3369 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(voice_level), 0.0);
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3370 gtk_widget_set_sensitive(voice_level, FALSE);
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3371 g_object_disconnect(voice_volume, "any-signal::value-changed",
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3372 G_CALLBACK(on_volume_change_cb), NULL,
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3373 NULL);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3374 g_object_disconnect(test, "any-signal::destroy",
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3375 G_CALLBACK(voice_test_destroy_cb), NULL,
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3376 NULL);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3377 g_object_disconnect(win->notebook, "any-signal::switch-page",
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3378 G_CALLBACK(vv_test_switch_page_cb), test,
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3379 NULL);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3380 voice_test_destroy_cb(NULL, NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3381 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3382 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3383
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3384 static void
33622
cd86e355b945 Fix some function arguments, which were the real cause of ce1a071ef316.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33564
diff changeset
3385 volume_changed_cb(GtkScaleButton *button, gdouble value, gpointer data)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3386 {
33622
cd86e355b945 Fix some function arguments, which were the real cause of ce1a071ef316.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33564
diff changeset
3387 purple_prefs_set_int("/purple/media/audio/volume/input", value * 100);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3388 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3389
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3390 static void
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3391 threshold_value_changed_cb(GtkScale *scale, GtkWidget *label)
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3392 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3393 int value;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3394 char *tmp;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3395
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3396 value = (int)gtk_range_get_value(GTK_RANGE(scale));
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3397 tmp = g_strdup_printf(_("Silence threshold: %d%%"), value);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3398 gtk_label_set_label(GTK_LABEL(label), tmp);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3399 g_free(tmp);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3400
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3401 purple_prefs_set_int("/purple/media/audio/silence_threshold", value);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3402 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3403
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3404 static void
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3405 make_voice_test(PidginPrefsWindow *win, GtkWidget *vbox)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3406 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3407 GtkWidget *test;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3408 GtkWidget *hbox;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3409 GtkWidget *label;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3410 GtkWidget *level;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3411 GtkWidget *volume;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3412 GtkWidget *threshold;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3413 char *tmp;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3414
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3415 label = gtk_label_new(NULL);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3416 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3417
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
3418 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_CAT_SPACE);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3419 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3420 label = gtk_label_new(_("Volume:"));
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3421 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3422 volume = gtk_volume_button_new();
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3423 gtk_box_pack_start(GTK_BOX(hbox), volume, TRUE, TRUE, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3424 gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume),
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3425 purple_prefs_get_int("/purple/media/audio/volume/input") / 100.0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3426 g_signal_connect(volume, "value-changed",
33519
ce1a071ef316 Fix a crash when changing the volume.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33515
diff changeset
3427 G_CALLBACK(volume_changed_cb), NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3428
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3429 tmp = g_strdup_printf(_("Silence threshold: %d%%"),
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3430 purple_prefs_get_int("/purple/media/audio/silence_threshold"));
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3431 label = gtk_label_new(tmp);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3432 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
39179
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
3433 gtk_label_set_xalign(GTK_LABEL(label), 0.0);
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
3434 gtk_label_set_yalign(GTK_LABEL(label), 0.5);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3435 g_free(tmp);
35532
2c802bb77720 Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35527
diff changeset
3436 threshold = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,
2c802bb77720 Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35527
diff changeset
3437 0, 100, 1);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3438 gtk_box_pack_start(GTK_BOX(vbox), threshold, FALSE, FALSE, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3439 gtk_range_set_value(GTK_RANGE(threshold),
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3440 purple_prefs_get_int("/purple/media/audio/silence_threshold"));
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3441 gtk_scale_set_draw_value(GTK_SCALE(threshold), FALSE);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3442 g_signal_connect(threshold, "value-changed",
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3443 G_CALLBACK(threshold_value_changed_cb), label);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3444
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3445 test = gtk_toggle_button_new_with_label(_("Test Audio"));
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3446 gtk_box_pack_start(GTK_BOX(vbox), test, FALSE, FALSE, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3447
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3448 level = gtk_progress_bar_new();
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3449 gtk_box_pack_start(GTK_BOX(vbox), level, FALSE, FALSE, 0);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3450 gtk_widget_set_sensitive(level, FALSE);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3451
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3452 voice_volume = volume;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3453 voice_level = level;
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
3454 voice_threshold = threshold;
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3455 g_signal_connect(test, "toggled",
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3456 G_CALLBACK(toggle_voice_test_cb), win);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3457 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3458
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3459 static GstElement *
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3460 create_video_pipeline(void)
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3461 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3462 GstElement *pipeline;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3463 GstElement *src, *sink;
37616
7ae670e19fb4 Add videoconvert into test video pipeline
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37615
diff changeset
3464 GstElement *videoconvert;
37653
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3465 GstElement *videoscale;
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3466
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3467 pipeline = gst_pipeline_new("videotest");
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3468 src = create_test_element(PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SRC);
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
3469 sink = create_test_element(PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SINK);
37616
7ae670e19fb4 Add videoconvert into test video pipeline
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37615
diff changeset
3470 videoconvert = gst_element_factory_make("videoconvert", NULL);
37653
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3471 videoscale = gst_element_factory_make("videoscale", NULL);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3472
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3473 g_object_set_data(G_OBJECT(pipeline), "sink", sink);
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3474
37653
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3475 gst_bin_add_many(GST_BIN(pipeline), src, videoconvert, videoscale, sink,
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3476 NULL);
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3477 gst_element_link_many(src, videoconvert, videoscale, sink, NULL);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3478
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3479 return pipeline;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3480 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3481
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3482 static void
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3483 video_test_destroy_cb(GtkWidget *w, gpointer data)
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3484 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3485 if (!video_pipeline)
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3486 return;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3487
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3488 gst_element_set_state(video_pipeline, GST_STATE_NULL);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3489 gst_object_unref(video_pipeline);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3490 video_pipeline = NULL;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3491 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3492
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3493 static void
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3494 window_id_cb(GstBus *bus, GstMessage *msg, gulong window_id)
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3495 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3496 if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT
33509
60647bc63acc Bump GStreamer checks to 1.0.0 instead of 0.11.0.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33508
diff changeset
3497 #if GST_CHECK_VERSION(1,0,0)
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3498 || !gst_is_video_overlay_prepare_window_handle_message(msg))
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3499 #else
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3500 /* there may be have-xwindow-id also, in case something went wrong */
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3501 || !gst_structure_has_name(msg->structure, "prepare-xwindow-id"))
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3502 #endif
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3503 return;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3505 g_signal_handlers_disconnect_matched(bus,
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3506 G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3507 0, 0, NULL, window_id_cb,
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3508 (gpointer)window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3509
33509
60647bc63acc Bump GStreamer checks to 1.0.0 instead of 0.11.0.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33508
diff changeset
3510 #if GST_CHECK_VERSION(1,0,0)
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3511 gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg)),
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3512 window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3513 #elif GST_CHECK_VERSION(0,10,31)
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3514 gst_x_overlay_set_window_handle(GST_X_OVERLAY(GST_MESSAGE_SRC(msg)),
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3515 window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3516 #else
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3517 gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(GST_MESSAGE_SRC(msg)),
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3518 window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3519 #endif
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3520 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3521
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3522 static void
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3523 enable_video_test(void)
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3524 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3525 GstBus *bus;
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3526 GdkWindow *window = gtk_widget_get_window(video_drawing_area);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3527 gulong window_id = 0;
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3528
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3529 #ifdef GDK_WINDOWING_WIN32
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3530 if (GDK_IS_WIN32_WINDOW(window))
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3531 window_id = GPOINTER_TO_UINT(GDK_WINDOW_HWND(window));
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3532 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3533 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3534 #ifdef GDK_WINDOWING_X11
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3535 if (GDK_IS_X11_WINDOW(window))
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3536 window_id = gdk_x11_window_get_xid(window);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3537 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3538 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3539 #ifdef GDK_WINDOWING_QUARTZ
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3540 if (GDK_IS_QUARTZ_WINDOW(window))
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3541 window_id = (gulong)gdk_quartz_window_get_nsview(window);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3542 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3543 #endif
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3544 g_warning("Unsupported GDK backend");
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3545 #if !(defined(GDK_WINDOWING_WIN32) \
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3546 || defined(GDK_WINDOWING_X11) \
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3547 || defined(GDK_WINDOWING_QUARTZ))
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3548 # error "Unsupported GDK windowing system"
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3549 #endif
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3550
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3551 video_pipeline = create_video_pipeline();
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3552 bus = gst_pipeline_get_bus(GST_PIPELINE(video_pipeline));
33509
60647bc63acc Bump GStreamer checks to 1.0.0 instead of 0.11.0.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33508
diff changeset
3553 #if GST_CHECK_VERSION(1,0,0)
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3554 gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL, NULL);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3555 #else
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3556 gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3557 #endif
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3558 g_signal_connect(bus, "sync-message::element",
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3559 G_CALLBACK(window_id_cb), (gpointer)window_id);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3560 gst_object_unref(bus);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3561
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3562 gst_element_set_state(GST_ELEMENT(video_pipeline), GST_STATE_PLAYING);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3563 }
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3564
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3565 static void
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3566 toggle_video_test_cb(GtkToggleButton *test, gpointer data)
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3567 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3568 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3569
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3570 if (gtk_toggle_button_get_active(test)) {
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3571 enable_video_test();
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3572 g_signal_connect(test, "destroy",
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3573 G_CALLBACK(video_test_destroy_cb), NULL);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3574 g_signal_connect(win->notebook, "switch-page",
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3575 G_CALLBACK(vv_test_switch_page_cb), test);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3576 } else {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3577 g_object_disconnect(test, "any-signal::destroy",
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3578 G_CALLBACK(video_test_destroy_cb), NULL,
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3579 NULL);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3580 g_object_disconnect(win->notebook, "any-signal::switch-page",
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3581 G_CALLBACK(vv_test_switch_page_cb), test,
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
3582 NULL);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3583 video_test_destroy_cb(NULL, NULL);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3584 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3585 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3586
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3587 static void
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3588 make_video_test(PidginPrefsWindow *win, GtkWidget *vbox)
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3589 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3590 GtkWidget *test;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3591 GtkWidget *video;
37589
e498a88e7c00 Factor out video widget creation into pidgin_create_video_widget()
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37547
diff changeset
3592
e498a88e7c00 Factor out video widget creation into pidgin_create_video_widget()
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37547
diff changeset
3593 video_drawing_area = video = pidgin_create_video_widget();
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3594 gtk_box_pack_start(GTK_BOX(vbox), video, TRUE, TRUE, 0);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3595 gtk_widget_set_size_request(GTK_WIDGET(video), 240, 180);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3596
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3597 test = gtk_toggle_button_new_with_label(_("Test Video"));
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3598 gtk_box_pack_start(GTK_BOX(vbox), test, FALSE, FALSE, 0);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3599
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3600 g_signal_connect(test, "toggled",
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3601 G_CALLBACK(toggle_video_test_cb), win);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3602 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3603
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3604 static void
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3605 vv_device_changed_cb(const gchar *name, PurplePrefType type,
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3606 gconstpointer value, gpointer data)
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3607 {
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3608 PurpleMediaManager *manager;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3609 PurpleMediaElementInfo *info;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3610
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3611 manager = purple_media_manager_get();
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3612 info = purple_media_manager_get_element_info(manager, value);
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3613 purple_media_manager_set_active_element(manager, info);
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3614
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3615 /* Refresh test viewers */
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3616 if (strstr(name, "audio") && voice_pipeline) {
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3617 voice_test_destroy_cb(NULL, NULL);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3618 enable_voice_test();
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3619 } else if(strstr(name, "video") && video_pipeline) {
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3620 video_test_destroy_cb(NULL, NULL);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3621 enable_video_test();
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3622 }
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3623 }
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3624
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3625 static const char *
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3626 purple_media_type_to_preference_key(PurpleMediaElementType type)
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3627 {
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3628 if (type & PURPLE_MEDIA_ELEMENT_AUDIO) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3629 if (type & PURPLE_MEDIA_ELEMENT_SRC) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3630 return PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device";
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3631 } else if (type & PURPLE_MEDIA_ELEMENT_SINK) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3632 return PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device";
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3633 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3634 } else if (type & PURPLE_MEDIA_ELEMENT_VIDEO) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3635 if (type & PURPLE_MEDIA_ELEMENT_SRC) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3636 return PIDGIN_PREFS_ROOT "/vvconfig/video/src/device";
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3637 } else if (type & PURPLE_MEDIA_ELEMENT_SINK) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3638 return PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device";
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3639 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3640 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3641
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3642 return NULL;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3643 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3644
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3645 static GtkWidget *
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3646 make_vv_dropdown(GtkWidget *parent, GtkSizeGroup *size_group,
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3647 PurpleMediaElementType element_type)
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3648 {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3649 GtkWidget *label;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3650 const gchar *preference_key;
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3651 GList *devices;
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3652
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3653 preference_key = purple_media_type_to_preference_key(element_type);
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3654 devices = get_vv_device_menuitems(element_type);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3655
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3656 if (g_list_find_custom(devices, purple_prefs_get_string(preference_key),
35689
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3657 (GCompareFunc)strcmp) == NULL)
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3658 {
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3659 GList *next = g_list_next(devices);
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3660 if (next)
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3661 purple_prefs_set_string(preference_key, next->data);
35689
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3662 }
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3663
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3664 label = pidgin_prefs_dropdown_from_list(parent, _("_Device"),
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3665 PURPLE_PREF_STRING, preference_key, devices);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3666
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3667 g_list_free_full(devices, g_free);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3668
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3669 gtk_size_group_add_widget(size_group, label);
39179
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
3670 gtk_label_set_xalign(GTK_LABEL(label), 0.0);
a59305ca30bb Use correct alignment functions for labels.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39178
diff changeset
3671 gtk_label_set_yalign(GTK_LABEL(label), 0.5);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3672
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3673 /* Return the parent GtkBox of dropdown and label, which was created
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3674 * in pidgin_prefs_dropdown_from_list(). */
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3675 return gtk_widget_get_parent(label);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3676 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3677
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3678 static GtkWidget *
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3679 make_vv_frame(GtkWidget *parent, GtkSizeGroup *sg,
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3680 const gchar *name, PurpleMediaElementType type)
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3681 {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3682 GtkWidget *vbox;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3683 GtkWidget *dropdown;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3684
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3685 vbox = pidgin_make_frame(parent, name);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3686
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3687 dropdown = make_vv_dropdown(vbox, sg, type);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3688
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3689 purple_prefs_connect_callback(vbox,
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3690 purple_media_type_to_preference_key(type),
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3691 vv_device_changed_cb, vbox);
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3692 g_signal_connect_swapped(vbox, "destroy",
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3693 G_CALLBACK(purple_prefs_disconnect_by_handle), vbox);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3694
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3695 g_object_set_data(G_OBJECT(vbox), "vv_frame", vbox);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3696 g_object_set_data(G_OBJECT(vbox), "vv_dropdown", dropdown);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3697 g_object_set_data(G_OBJECT(vbox), "vv_size_group", sg);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3698 g_object_set_data(G_OBJECT(vbox), "vv_media_type", (gpointer)type);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3699
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3700 return vbox;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3701 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3702
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3703 static void
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3704 device_list_changed_cb(PurpleMediaManager *manager, GtkWidget *widget)
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3705 {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3706 GtkWidget *frame;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3707 GtkWidget *dropdown;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3708 PurpleMediaElementType media_type;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3709
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3710 gtk_widget_destroy(g_object_get_data(G_OBJECT(widget), "vv_dropdown"));
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3711
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3712 frame = g_object_get_data(G_OBJECT(widget), "vv_frame");
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3713 media_type = (PurpleMediaElementType)g_object_get_data(G_OBJECT(widget),
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3714 "vv_media_type");
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3715
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3716 dropdown = make_vv_dropdown(frame,
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3717 g_object_get_data(G_OBJECT(widget), "vv_size_group"),
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3718 media_type);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3719
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3720 g_object_set_data(G_OBJECT(widget), "vv_dropdown", dropdown);
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3721 }
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3722
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3723 static GtkWidget *
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3724 vv_page(PidginPrefsWindow *win)
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3725 {
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3726 GtkWidget *ret;
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3727 GtkWidget *vbox;
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3728 GtkWidget *frame;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3729 GtkSizeGroup *sg;
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3730 PurpleMediaManager *manager;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3731
35527
707c3c2b2c8a Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35510
diff changeset
3732 ret = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_CAT_SPACE);
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3733 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3734
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3735 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3736
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3737 manager = purple_media_manager_get();
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3738
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3739 vbox = pidgin_make_frame(ret, _("Audio"));
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3740 frame = make_vv_frame(vbox, sg, _("Input"),
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3741 PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SRC);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3742 g_signal_connect_object(manager, "elements-changed::audiosrc",
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3743 G_CALLBACK(device_list_changed_cb), frame, 0);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3744
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3745 frame = make_vv_frame(vbox, sg, _("Output"),
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3746 PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SINK);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3747 g_signal_connect_object(manager, "elements-changed::audiosink",
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3748 G_CALLBACK(device_list_changed_cb), frame, 0);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3749
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3750 make_voice_test(win, vbox);
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3751
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3752 vbox = pidgin_make_frame(ret, _("Video"));
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3753 frame = make_vv_frame(vbox, sg, _("Input"),
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3754 PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SRC);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3755 g_signal_connect_object(manager, "elements-changed::videosrc",
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3756 G_CALLBACK(device_list_changed_cb), frame, 0);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3757
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3758 frame = make_vv_frame(vbox, sg, _("Output"),
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3759 PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SINK);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3760 g_signal_connect_object(manager, "elements-changed::videosink",
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3761 G_CALLBACK(device_list_changed_cb), frame, 0);
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3762
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3763 make_video_test(win, vbox);
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3764
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3765 gtk_widget_show_all(ret);
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3766
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3767 return ret;
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3768 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3769 #endif
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3770
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
3771 static int
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3772 prefs_notebook_add_page(GtkNotebook *notebook, const char *text,
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3773 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
3774 {
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3775 return gtk_notebook_insert_page(notebook, page, gtk_label_new(text), ind);
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
3776 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3777
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
3778 static void
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3779 prefs_notebook_init(PidginPrefsWindow *win)
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
3780 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3781 GtkNotebook *notebook = GTK_NOTEBOOK(win->notebook);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3782 int notebook_page = 0;
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3783
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3784 bind_interface_page(win);
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3785 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
3786
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3787 #ifdef _WIN32
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
3788 /* We use the registered default browser in windows */
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3789 gtk_widget_hide(win->browser.page);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3790 #else
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
3791 /* if the user is running Mac OS X, hide the browsers tab */
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3792 if (purple_running_osx()) {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3793 gtk_widget_hide(win->browser.page);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3794 } else {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3795 bind_browser_page(win);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3796 notebook_page++;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3797 }
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
3798 #endif
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
3799
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3800 bind_conv_page(win);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3801 notebook_page++;
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3802 bind_logging_page(win);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3803 notebook_page++;
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3804 bind_network_page(win);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3805 notebook_page++;
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3806 bind_proxy_page(win);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3807 notebook_page++;
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3808 prefs_notebook_add_page(notebook, _("Password Storage"), keyring_page(), notebook_page++);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3809
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3810 prefs_notebook_add_page(notebook, _("Sounds"), sound_page(), notebook_page++);
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3811 bind_away_page(win);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3812 notebook_page++;
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3813 prefs_notebook_add_page(notebook, _("Themes"), theme_page(), notebook_page++);
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
3814 #ifdef USE_VV
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3815 prefs_notebook_add_page(notebook, _("Voice/Video"), vv_page(win), notebook_page++);
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3816 #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
3817 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3818
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3819 static void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3820 pidgin_prefs_window_class_init(PidginPrefsWindowClass *klass)
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
3821 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3822 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3823
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3824 gtk_widget_class_set_template_from_resource(
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3825 widget_class,
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3826 "/im/pidgin/Pidgin/Prefs/prefs.ui"
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3827 );
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3828
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3829 /* Main window */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3830 gtk_widget_class_bind_template_child(
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3831 widget_class, PidginPrefsWindow, notebook);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3832 gtk_widget_class_bind_template_callback(widget_class, delete_prefs);
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3833
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3834 /* Interface page */
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3835 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3836 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3837 iface.docklet.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3838 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3839 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3840 iface.im.hide_new.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3841 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3842 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3843 iface.win32.minimize_new_convs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3844 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3845 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3846 iface.conversations.tabs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3847 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3848 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3849 iface.conversations.tabs_vbox);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3850 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3851 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3852 iface.conversations.close_on_tabs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3853 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3854 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3855 iface.conversations.tab_side.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3856 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3857 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3858 iface.conversations.placement.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3859
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3860 /* Browser page */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3861 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3862 widget_class, PidginPrefsWindow, browser.page);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3863 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3864 widget_class, PidginPrefsWindow, browser.stack);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3865 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3866 widget_class, PidginPrefsWindow, browser.gnome_not_found);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3867 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3868 widget_class, PidginPrefsWindow, browser.gnome_program);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3869 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3870 widget_class, PidginPrefsWindow, browser.browser.combo);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3871 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3872 widget_class, PidginPrefsWindow, browser.place_hbox);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3873 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3874 widget_class, PidginPrefsWindow, browser.place.combo);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3875 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3876 widget_class, PidginPrefsWindow, browser.manual_command_hbox);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3877 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3878 widget_class, PidginPrefsWindow, browser.manual_command);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3879 gtk_widget_class_bind_template_callback(widget_class,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3880 browser_button_clicked_cb);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3881 gtk_widget_class_bind_template_callback(widget_class,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3882 manual_browser_set);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3883
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3884 /* Conversations page */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3885 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3886 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3887 conversations.notification_chat.combo);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3888 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3889 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3890 conversations.show_incoming_formatting);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3891 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3892 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3893 conversations.im.close_immediately);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3894 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3895 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3896 conversations.im.show_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3897 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3898 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3899 conversations.im.animate_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3900 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3901 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3902 conversations.im.send_typing);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3903 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3904 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3905 conversations.spellcheck);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3906 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3907 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3908 conversations.use_smooth_scrolling);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3909 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3910 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3911 conversations.win32.blink_im);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3912 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3913 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3914 conversations.resize_custom_smileys);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3915 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3916 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3917 conversations.custom_smileys_size);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3918 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3919 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3920 conversations.minimum_entry_lines);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3921 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3922 widget_class, PidginPrefsWindow,
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
3923 conversations.format_buffer);
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
3924 gtk_widget_class_bind_template_child(
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
3925 widget_class, PidginPrefsWindow,
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
3926 conversations.format_view);
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3927 #ifdef WIN32
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3928 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3929 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3930 conversations.font_frame);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3931 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3932 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3933 conversations.use_theme_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3934 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3935 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3936 conversations.custom_font_hbox);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3937 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3938 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3939 conversations.custom_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3940 #endif
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3941 /* Even though Win32-specific, must be bound to avoid Glade warnings. */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3942 gtk_widget_class_bind_template_callback(widget_class,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3943 apply_custom_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3944 gtk_widget_class_bind_template_callback(widget_class,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3945 pidgin_custom_font_set);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3946
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3947 /* Logging page */
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3948 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3949 widget_class, PidginPrefsWindow, logging.format.combo);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3950 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3951 widget_class, PidginPrefsWindow, logging.log_ims);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3952 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3953 widget_class, PidginPrefsWindow, logging.log_chats);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3954 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3955 widget_class, PidginPrefsWindow, logging.log_system);
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3956
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3957 /* Network page */
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3958 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3959 widget_class, PidginPrefsWindow, network.stun_server);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3960 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3961 widget_class, PidginPrefsWindow, network.auto_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3962 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3963 widget_class, PidginPrefsWindow, network.public_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3964 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3965 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3966 network.public_ip_hbox);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3967 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3968 widget_class, PidginPrefsWindow, network.map_ports);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3969 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3970 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3971 network.ports_range_use);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3972 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3973 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3974 network.ports_range_hbox);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3975 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3976 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3977 network.ports_range_start);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3978 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3979 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3980 network.ports_range_end);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3981 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3982 widget_class, PidginPrefsWindow, network.turn_server);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3983 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3984 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3985 network.turn_port_udp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3986 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3987 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3988 network.turn_port_tcp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3989 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3990 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3991 network.turn_username);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3992 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3993 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3994 network.turn_password);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3995 gtk_widget_class_bind_template_callback(widget_class,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3996 network_stun_server_changed_cb);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3997 gtk_widget_class_bind_template_callback(widget_class,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3998 auto_ip_button_clicked_cb);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3999 gtk_widget_class_bind_template_callback(widget_class,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
4000 network_ip_changed);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
4001 gtk_widget_class_bind_template_callback(widget_class,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
4002 network_turn_server_changed_cb);
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4003
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4004 /* Proxy page */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4005 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4006 widget_class, PidginPrefsWindow, proxy.stack);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4007 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4008 widget_class, PidginPrefsWindow, proxy.gnome_not_found);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4009 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4010 widget_class, PidginPrefsWindow, proxy.gnome_program);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4011 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4012 widget_class, PidginPrefsWindow,
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4013 proxy.socks4_remotedns);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4014 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4015 widget_class, PidginPrefsWindow, proxy.type.combo);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4016 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4017 widget_class, PidginPrefsWindow, proxy.options);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4018 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4019 widget_class, PidginPrefsWindow, proxy.host);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4020 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4021 widget_class, PidginPrefsWindow, proxy.port);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4022 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4023 widget_class, PidginPrefsWindow, proxy.username);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4024 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4025 widget_class, PidginPrefsWindow, proxy.password);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4026 gtk_widget_class_bind_template_callback(widget_class,
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4027 proxy_button_clicked_cb);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4028 gtk_widget_class_bind_template_callback(widget_class,
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
4029 proxy_print_option);
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4030
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4031 /* Away page */
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4032 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4033 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4034 away.idle_reporting.combo);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4035 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4036 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4037 away.mins_before_away);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4038 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4039 widget_class, PidginPrefsWindow, away.away_when_idle);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4040 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4041 widget_class, PidginPrefsWindow, away.idle_hbox);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4042 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4043 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4044 away.auto_reply.combo);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4045 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4046 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4047 away.startup_current_status);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4048 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4049 widget_class, PidginPrefsWindow, away.startup_hbox);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4050 gtk_widget_class_bind_template_child(
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
4051 widget_class, PidginPrefsWindow, away.startup_label);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4052 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4053
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4054 static void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4055 pidgin_prefs_window_init(PidginPrefsWindow *win)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4056 {
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
4057 /* 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
4058 * 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
4059 /* (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
4060
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4061 /* 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
4062
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4063 /* Create the window */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4064 gtk_widget_init_template(GTK_WIDGET(win));
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4065
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4066 prefs_notebook_init(win);
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
4067
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
4068 /* 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
4069 prefs_themes_refresh();
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4070 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4071
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4072 void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4073 pidgin_prefs_show(void)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4074 {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4075 if (prefs == NULL) {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4076 prefs = PIDGIN_PREFS_WINDOW(g_object_new(
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4077 pidgin_prefs_window_get_type(), NULL));
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4078 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4079
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
4080 gtk_window_present(GTK_WINDOW(prefs));
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
4081 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4082
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4083 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
4084 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
4085 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
4086 {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4087 const gchar *theme_name = value;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4088 GList *themes, *it;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4089
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
4090 if (purple_strequal(theme_name, "none")) {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4091 purple_smiley_theme_set_current(NULL);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4092 return;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4093 }
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4094
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4095 /* XXX: could be cached when initializing prefs view */
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4096 themes = pidgin_smiley_theme_get_all();
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4097
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4098 for (it = themes; it; it = g_list_next(it)) {
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4099 PidginSmileyTheme *theme = it->data;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4100
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
4101 if (!purple_strequal(pidgin_smiley_theme_get_name(theme), theme_name))
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4102 continue;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4103
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
4104 purple_smiley_theme_set_current(PURPLE_SMILEY_THEME(theme));
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
4105 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4106 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4107
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4108 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
4109 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
4110 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4111 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
4112 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
4113
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4114 #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
4115 /* 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
4116 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
4117 purple_prefs_add_int(PIDGIN_PREFS_ROOT "/browsers/place", PIDGIN_BROWSER_DEFAULT);
30810
9e2f351bb081 Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30800
diff changeset
4118 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", "");
30817
826c743cb473 Change default browser for new non-Windows users to xdg-open. Fixes #12505.
Stanislav Brabec <sbrabec@suse.cz>
parents: 30812
diff changeset
4119 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/browsers/browser", "xdg-open");
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
4120 #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
4121
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4122 /* 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
4123 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
4124 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
4125
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4126 /* 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
4127 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
4128 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
4129 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
4130 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
4131
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
4132 /* Themes */
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
4133 prefs_themes_init();
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
4134
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
4135 /* Conversation Themes */
32563
27024ee86815 Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32562
diff changeset
4136 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations");
27024ee86815 Use a consistent prefs name. It should be conversation*s* to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32562
diff changeset
4137 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/theme", "Default");
32560
60ee2f81bb3d Add a prefs combo for the conversation theme. Variants are added as
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31992
diff changeset
4138
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
4139 /* 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
4140 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
4141 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
4142
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4143 /* Smiley Callbacks */
29154
630b98626232 Since the prefs variable holds the widget that refers to the prefs dialog,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29152
diff changeset
4144 purple_prefs_connect_callback(&prefs, PIDGIN_PREFS_ROOT "/smileys/theme",
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
4145 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
4146
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
4147 #ifdef USE_VV
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4148 /* Voice/Video */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4149 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4150 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/audio");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4151 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/audio/src");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4152 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device", "");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4153 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/audio/sink");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4154 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device", "");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4155 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4156 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video/src");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4157 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/video/src/device", "");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4158 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4159 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/vvconfig/video/sink");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4160 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device", "");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4161 #endif
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4162
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
4163 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
4164 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4165
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
4166 void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
4167 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
4168 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4169 /* 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
4170 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
4171 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
4172 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
4173 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
4174
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4175 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
4176
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4177 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
4178 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
4179
30810
9e2f351bb081 Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30800
diff changeset
4180 /*
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4181 * This path pref changed to a string, so migrate. I know this will
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4182 * break things for and confuse users that use multiple versions with
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4183 * the same config directory, but I'm not inclined to want to deal with
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4184 * that at the moment. -- rekkanoryo
30810
9e2f351bb081 Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30800
diff changeset
4185 */
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4186 if (purple_prefs_exists(PIDGIN_PREFS_ROOT "/browsers/command") &&
35378
5d9e2581005b gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents: 35106
diff changeset
4187 purple_prefs_get_pref_type(PIDGIN_PREFS_ROOT "/browsers/command") ==
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4188 PURPLE_PREF_PATH)
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4189 {
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4190 const char *str = purple_prefs_get_path(
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4191 PIDGIN_PREFS_ROOT "/browsers/command");
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4192 purple_prefs_set_string(
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
4193 PIDGIN_PREFS_ROOT "/browsers/manual_command", str);
30810
9e2f351bb081 Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30800
diff changeset
4194 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/command");
9e2f351bb081 Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30800
diff changeset
4195 }
9e2f351bb081 Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30800
diff changeset
4196
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
4197 /* 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
4198 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
4199 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
4200 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
4201 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
4202 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
4203 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/show_warning_level");
34259
5309bb9956cf Remove the tooltip_delay pref from prefs.xml.
Mark Doliner <mark@kingant.net>
parents: 34241
diff changeset
4204 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/tooltip_delay");
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
4205 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
4206 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
4207 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
4208 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
4209 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
4210 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
4211 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
4212 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
4213 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
4214 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
4215 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
4216 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
4217 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/use_custom_font");
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4218 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
4219 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
4220 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
4221 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
4222 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
4223 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
4224 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
4225 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
4226 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands");
32732
3166ba6f2096 We haven't used this pref in a while. We stopped adding it in
Mark Doliner <markdoliner@pidgin.im>
parents: 32596
diff changeset
4227 purple_prefs_remove(PIDGIN_PREFS_ROOT "/debug/timestamps");
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
4228 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
4229 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
4230 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
4231 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
4232
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4233 /* 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
4234 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
4235 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
4236 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4237 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
4238 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4239 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
4240 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
4241 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4242 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
4243 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4244 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
4245 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
4246 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
4247
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
4248 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
4249 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
4250 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
4251 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
4252 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
4253 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
4254 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
4255 PIDGIN_PREFS_ROOT "/conversations/im/y");
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4256
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4257 /* Fixup vvconfig plugin prefs */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4258 if (purple_prefs_exists("/plugins/core/vvconfig/audio/src/device")) {
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4259 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device",
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4260 purple_prefs_get_string("/plugins/core/vvconfig/audio/src/device"));
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4261 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4262 if (purple_prefs_exists("/plugins/core/vvconfig/audio/sink/device")) {
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4263 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device",
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4264 purple_prefs_get_string("/plugins/core/vvconfig/audio/sink/device"));
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4265 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4266 if (purple_prefs_exists("/plugins/core/vvconfig/video/src/device")) {
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4267 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/vvconfig/video/src/device",
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4268 purple_prefs_get_string("/plugins/core/vvconfig/video/src/device"));
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4269 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4270 if (purple_prefs_exists("/plugins/gtk/vvconfig/video/sink/device")) {
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4271 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device",
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4272 purple_prefs_get_string("/plugins/gtk/vvconfig/video/sink/device"));
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4273 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4274
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4275 purple_prefs_remove("/plugins/core/vvconfig");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4276 purple_prefs_remove("/plugins/gtk/vvconfig");
35105
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4277
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
4278 purple_prefs_remove(PIDGIN_PREFS_ROOT "/vvconfig/audio/src/plugin");
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
4279 purple_prefs_remove(PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/plugin");
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
4280 purple_prefs_remove(PIDGIN_PREFS_ROOT "/vvconfig/video/src/plugin");
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
4281 purple_prefs_remove(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/plugin");
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
4282
35105
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4283 #ifndef _WIN32
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4284 /* Added in 3.0.0. */
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4285 if (purple_prefs_get_int(PIDGIN_PREFS_ROOT "/browsers/place") == 1) {
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4286 /* If the "open link in" pref is set to the old value for "existing
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4287 window" then change it to "default." */
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4288 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/browsers/place",
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4289 PIDGIN_BROWSER_DEFAULT);
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4290 }
35106
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
4291
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
4292 /* Added in 3.0.0. */
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
4293 if (g_str_equal(
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
4294 purple_prefs_get_string(PIDGIN_PREFS_ROOT "/browsers/browser"),
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
4295 "netscape")) {
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
4296 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", "xdg-open");
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
4297 }
35105
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
4298 #endif /* !_WIN32 */
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
4299 }
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
4300

mercurial