pidgin/gtkprefs.c

Fri, 15 Nov 2019 01:27:30 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Fri, 15 Nov 2019 01:27:30 -0600
changeset 40197
75ffd76260fc
parent 40195
fb4b0ae193c0
child 40203
565eb39a3a01
permissions
-rw-r--r--

Bump the gtk minimum to 3.22 and remove 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
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"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
25 #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
26
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
27 #include "debug.h"
27522
9f8afd7cd40d In the Network prefs page, always show the auto-detected IP address by
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27521
diff changeset
28 #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
29 #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
30 #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
31 #include "proxy.h"
36543
a8c3fecee2d3 Renamed prpl.[ch] to protocol.[ch]
Ankit Vani <a@nevitus.org>
parents: 34883
diff changeset
32 #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
33 #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
34 #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
35 #include "sound.h"
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
36 #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
37 #include "stun.h"
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
38 #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
39 #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
40 #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
41 #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
42 #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
43
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
44 #include "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
45 #include "gtkconv.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
46 #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
47 #include "gtkprefs.h"
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
48 #include "gtksavedstatuses.h"
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
49 #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
50 #include "gtksound.h"
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
51 #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
52 #include "gtkutils.h"
39152
37144ff35a91 Rename gtkdebug -> pidgindebug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38578
diff changeset
53 #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
54 #include "pidginstock.h"
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
55 #ifdef USE_VV
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
56 #include "media-gst.h"
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
57 #include <gst/video/videooverlay.h>
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
58 #ifdef GDK_WINDOWING_WIN32
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
59 #include <gdk/gdkwin32.h>
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
60 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
61 #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
62 #include <gdk/gdkx.h>
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
63 #endif
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
64 #ifdef GDK_WINDOWING_QUARTZ
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
65 #include <gdk/gdkquartz.h>
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
66 #endif
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
67 #endif
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
68 #include <libsoup/soup.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
69
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
70 #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
71
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
72 /* 25MB */
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
73 #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
74
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
75 struct theme_info {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
76 gchar *type;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
77 gchar *extension;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
78 gchar *original_name;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
79 };
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
80
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
81 typedef struct _PidginPrefCombo PidginPrefCombo;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
82
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
83 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
84 PidginPrefCombo *combo);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
85
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
86 struct _PidginPrefCombo {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
87 GtkWidget *combo;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
88 PurplePrefType type;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
89 const gchar *key;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
90 union {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
91 const char *string;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
92 int integer;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
93 gboolean boolean;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
94 } value;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
95 gint previously_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
96 gint current_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
97 PidginPrefsBindDropdownCallback cb;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
98 };
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
99
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
100 struct _PidginPrefsWindow {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
101 GtkDialog parent;
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
102
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
103 /* Stack */
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
104 GtkWidget *stack;
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
105
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
106 /* Interface page */
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
107 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
108 PidginPrefCombo docklet;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
109 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
110 PidginPrefCombo hide_new;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
111 } im;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
112 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
113 GtkWidget *minimize_new_convs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
114 } win32;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
115 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
116 GtkWidget *tabs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
117 GtkWidget *tabs_vbox;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
118 GtkWidget *close_on_tabs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
119 PidginPrefCombo tab_side;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
120 PidginPrefCombo placement;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
121 } conversations;
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
122 } iface;
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
123
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
124 /* Browser page */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
125 struct {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
126 GtkWidget *page;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
127 GtkWidget *stack;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
128 /* GNOME version */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
129 GtkWidget *gnome_not_found;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
130 GtkWidget *gnome_program;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
131 gchar *gnome_program_path;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
132 /* Non-GNOME version */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
133 PidginPrefCombo browser;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
134 GtkWidget *place_hbox;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
135 PidginPrefCombo place;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
136 GtkWidget *manual_command_hbox;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
137 GtkWidget *manual_command;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
138 } browser;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
139
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
140 /* Conversations page */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
141 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
142 PidginPrefCombo notification_chat;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
143 GtkWidget *show_incoming_formatting;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
144 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
145 GtkWidget *close_immediately;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
146 GtkWidget *show_buddy_icons;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
147 GtkWidget *animate_buddy_icons;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
148 GtkWidget *send_typing;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
149 } im;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
150 GtkWidget *spellcheck;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
151 GtkWidget *use_smooth_scrolling;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
152 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
153 GtkWidget *blink_im;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
154 } win32;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
155 GtkWidget *resize_custom_smileys;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
156 GtkWidget *custom_smileys_size;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
157 GtkWidget *minimum_entry_lines;
39264
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
158 GtkTextBuffer *format_buffer;
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
159 GtkWidget *format_view;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
160 /* Win32 specific frame */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
161 GtkWidget *font_frame;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
162 GtkWidget *use_theme_font;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
163 GtkWidget *custom_font_hbox;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
164 GtkWidget *custom_font;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
165 } conversations;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
166
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
167 /* Logging page */
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
168 struct {
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
169 PidginPrefCombo format;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
170 GtkWidget *log_ims;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
171 GtkWidget *log_chats;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
172 GtkWidget *log_system;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
173 } logging;
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
174
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
175 /* Network page */
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
176 struct {
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
177 GtkWidget *stun_server;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
178 GtkWidget *auto_ip;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
179 GtkWidget *public_ip;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
180 GtkWidget *public_ip_hbox;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
181 GtkWidget *map_ports;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
182 GtkWidget *ports_range_use;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
183 GtkWidget *ports_range_hbox;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
184 GtkWidget *ports_range_start;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
185 GtkWidget *ports_range_end;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
186 GtkWidget *turn_server;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
187 GtkWidget *turn_port_udp;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
188 GtkWidget *turn_port_tcp;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
189 GtkWidget *turn_username;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
190 GtkWidget *turn_password;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
191 } network;
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
192
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
193 /* Proxy page */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
194 struct {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
195 GtkWidget *stack;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
196 /* GNOME version */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
197 GtkWidget *gnome_not_found;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
198 GtkWidget *gnome_program;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
199 gchar *gnome_program_path;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
200 /* Non-GNOME version */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
201 GtkWidget *socks4_remotedns;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
202 PidginPrefCombo type;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
203 GtkWidget *options;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
204 GtkWidget *host;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
205 GtkWidget *port;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
206 GtkWidget *username;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
207 GtkWidget *password;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
208 } proxy;
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
209
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
210 /* Keyrings page */
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
211 struct {
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
212 PidginPrefCombo active;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
213 GtkWidget *vbox;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
214 PurpleRequestFields *settings;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
215 GtkWidget *settings_box;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
216 GtkWidget *apply;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
217 } keyring;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
218
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
219 /* Sounds page */
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
220 struct {
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
221 PidginPrefCombo method;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
222 GtkWidget *method_vbox;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
223 GtkWidget *command;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
224 GtkWidget *command_hbox;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
225 GtkWidget *mute;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
226 GtkWidget *conv_focus;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
227 PidginPrefCombo while_status;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
228 struct {
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
229 GtkWidget *view;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
230 GtkListStore *store;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
231 } event;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
232 GtkWidget *entry;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
233 } sound;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
234
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
235 /* Away page */
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
236 struct {
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
237 PidginPrefCombo idle_reporting;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
238 GtkWidget *mins_before_away;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
239 GtkWidget *idle_hbox;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
240 GtkWidget *away_when_idle;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
241 PidginPrefCombo auto_reply;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
242 GtkWidget *startup_current_status;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
243 GtkWidget *startup_hbox;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
244 GtkWidget *startup_label;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
245 } away;
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
246
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
247 /* Themes page */
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
248 struct {
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
249 SoupSession *session;
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
250 GtkWidget *blist;
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
251 GtkWidget *status;
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
252 GtkWidget *sound;
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
253 GtkWidget *smiley;
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
254 } theme;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
255
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
256 #ifdef USE_VV
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
257 /* Voice/Video page */
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
258 struct {
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
259 struct {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
260 PidginPrefCombo input;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
261 PidginPrefCombo output;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
262 GtkWidget *level;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
263 GtkWidget *threshold;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
264 GtkWidget *volume;
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
265 GtkWidget *test;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
266 GstElement *pipeline;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
267 } voice;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
268
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
269 struct {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
270 PidginPrefCombo input;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
271 PidginPrefCombo output;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
272 GtkWidget *drawing_area;
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
273 GtkWidget *test;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
274 GstElement *pipeline;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
275 } video;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
276 } vv;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
277 #endif
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
278 };
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
279
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
280 /* Main dialog */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
281 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
282
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
283 /* Themes page */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
284 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
285 static GtkWidget *prefs_blist_themes_combo_box;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
286 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
287 static GtkWidget *prefs_smiley_themes_combo_box;
23645
6901039a86fb Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23261
diff changeset
288
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
289 /* Sound theme specific */
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
290 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
291 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
292
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
293 /* 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
294 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
295 static GtkListStore *prefs_blist_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
296 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
297 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
298
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
299 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
300 * 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
301 */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
302 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
303 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
304
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
305 static void
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 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
307 {
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 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
309 int value;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
310
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
311 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
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 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
314 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
315
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
316 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
317 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
318 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
319 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
320 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
321 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
322 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
323
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
324 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
325
33172
9fb9057fc55c Fix warnings about GtkAdjustments on GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33170
diff changeset
326 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
327 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
328 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
329 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
330 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
331 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
332 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
333 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
334 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
335 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
336
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 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
338 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
339
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 static void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
341 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
342 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
343 GtkAdjustment *adjust;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
344 int val;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
345
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
346 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
347
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
348 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
349 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
350 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
351 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
352 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
353 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
354
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
355 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
356 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
357 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
358 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
359
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
360 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
361 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
362
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
363 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
364 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
365 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
366 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
367 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
368 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
369
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
370 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
371
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
372 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
373 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
374 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
375 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
376 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
377
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
378 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
379 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
380
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
381 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
382 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
383 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
384 const gchar *value;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
385
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
386 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
387
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
388 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
389 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
390 (char*)key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
391 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
392
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
393 GtkWidget *
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
394 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
395 const char *key, GtkSizeGroup *sg)
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
396 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
397 GtkWidget *entry;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
398 const gchar *value;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
399
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
400 value = purple_prefs_get_string(key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
401
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
402 entry = gtk_entry_new();
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
403 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
404 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
405 g_signal_connect(G_OBJECT(entry), "changed",
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
406 G_CALLBACK(entry_set), (char*)key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
407 gtk_widget_show(entry);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
408
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
409 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
410 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
411
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
412 /* 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
413 enum {
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
414 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
415 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
416 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
417 };
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
418
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
419 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
420 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
421 PurplePrefType type;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
422 union {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
423 const char *string;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
424 int integer;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
425 gboolean boolean;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
426 } value;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
427 } PidginPrefValue;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
428
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
429 typedef void (*PidginPrefsDropdownCallback)(GtkComboBox *combo_box,
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
430 PidginPrefValue value);
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
431
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
432 static void
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
433 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
434 {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
435 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
436 GtkTreeIter iter;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
437 GtkTreeModel *tree_model;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
438 PidginPrefValue active;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
439
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
440 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
441 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
442 return;
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
443 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
444 "type"));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
445
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
446 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
447 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
448 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
449 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
450
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
451 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
452 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
453 &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
454 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
455 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
456 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
457 &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
458 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
459 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
460 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
461 &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
462 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
463
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
464 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
465 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
466
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
467 static void
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
468 pidgin_prefs_bind_dropdown_revert_active(PidginPrefCombo *combo)
22419
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 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
470 g_return_if_fail(combo != NULL);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
471
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
472 combo->current_active = combo->previously_active;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
473
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
474 gtk_combo_box_set_active(GTK_COMBO_BOX(combo->combo),
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
475 combo->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
476 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
477
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
478 static GtkWidget *
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
479 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
480 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
481 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
482 {
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
483 GtkWidget *dropdown;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
484 GtkWidget *label = NULL;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
485 gchar *text;
32904
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
486 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
487 GtkTreeIter iter;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
488 GtkTreeIter active;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
489 GtkCellRenderer *renderer;
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
490 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
491
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
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
494 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
495 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
496 } 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
497 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
498 } 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
499 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
500 } else {
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
501 g_warn_if_reached();
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
502 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
503 }
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
504
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
505 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
506 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
507 *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
508 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
509
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
510 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
511 int int_value = 0;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
512 const char *str_value = NULL;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
513 gboolean bool_value = FALSE;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
514
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
515 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
516 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
517
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
518 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
519 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
520 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
521 -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
522
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
523 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
524 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
525 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
526 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
527 -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
528 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
529 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
530 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
531 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
532 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
533 -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
534 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
535 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
536 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
537 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
538 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
539 -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
540 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
541
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
542 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
543 initial.value.integer == int_value) ||
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
544 (initial.type == PURPLE_PREF_STRING &&
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
545 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
546 (initial.type == PURPLE_PREF_BOOLEAN &&
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
547 (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
548
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
549 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
550 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
551
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
552 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
553 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
554
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
555 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
556 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
557 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
558 "text", 0,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
559 NULL);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
560
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
561 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
562 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
563 dropdown)));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
564 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
565 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
566
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
567 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
568 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
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 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
571
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 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
573 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
574
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
575 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
576 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
577 PidginPrefValue value)
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
578 {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
579 const char *key;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
580
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
581 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
582
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
583 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
584 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
585 } 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
586 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
587 } 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
588 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
589 } else {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
590 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
591 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
592 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
593
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 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
595 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
596 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
597 {
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
598 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
599 GtkComboBox *dropdown = NULL;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
600 GtkWidget *label;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
601
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
602 initial.type = type;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
603 if (type == PURPLE_PREF_INT) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
604 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
605 } 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
606 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
607 } 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
608 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
609 } else {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
610 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
611 }
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
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
613 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
614 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
615
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
616 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
617
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 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
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
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 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
622 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
623 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
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_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
626 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
627 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
628 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
629 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
630 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
631
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 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
633 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
634
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 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
636 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
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 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
639
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
640 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
641 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
642 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
643 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
644 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
645 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
646 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
647 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
648 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
649 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
650
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
651 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
652
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
653 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
654
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
655 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
656 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
657
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
658 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
659
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
660 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
661 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
662
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
663 static void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
664 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
665 PidginPrefCombo *combo)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
666 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
667 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
668 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
669 } 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
670 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
671 } 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
672 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
673 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
674 g_return_if_reached();
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 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
677
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
678 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
679 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
680 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
681 PidginPrefCombo *combo = data;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
682 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
683 GtkTreeModel *tree_model;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
684
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
685 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
686 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
687 return;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
688
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
689 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
690 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
691
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
692 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
693 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
694 &combo->value.integer, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
695 }
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 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
698 &combo->value.string, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
699 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
700 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
701 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
702 &combo->value.boolean, -1);
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
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
705 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
706 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
707
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
708 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
709 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
710 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
711 gchar *text;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
712 GtkListStore *store = NULL;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
713 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
714 GtkTreeIter active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
715
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
716 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
717
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
718 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
719 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
720 } 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
721 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
722 } 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
723 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
724 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
725 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
726 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
727
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
728 store = GTK_LIST_STORE(
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
729 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
730
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
731 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
732 int int_value = 0;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
733 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
734 gboolean bool_value = FALSE;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
735
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
736 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
737 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
738
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
739 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
740 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
741 PREF_DROPDOWN_TEXT, text,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
742 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
743
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
744 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
745 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
746 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
747 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
748 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
749 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
750 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
751 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
752 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
753 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
754 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
755 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
756 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
757 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
758 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
759 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
760 -1);
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
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
763 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
764 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
765 (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
766 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
767 (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
768 (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
769
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
770 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
771 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
772
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
773 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
774 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
775
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
776 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
777 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
778 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
779 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
780
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
781 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
782 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
783 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
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 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
787 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
788 {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
789 GtkTreeModel *store = NULL;
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
790 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
791 GtkTreeIter active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
792
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
793 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
794 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
795 } 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
796 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
797 } 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
798 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
799 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
800 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
801 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
802
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
803 store = gtk_combo_box_get_model(GTK_COMBO_BOX(combo->combo));
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
804
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
805 if (!gtk_tree_model_get_iter_first(store, &iter)) {
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
806 g_return_if_reached();
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 do {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
810 int int_value = 0;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
811 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
812 gboolean bool_value = FALSE;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
813
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
814 if (combo->type == PURPLE_PREF_INT) {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
815 gtk_tree_model_get(store, &iter,
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
816 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
817 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
818 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
819 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
820 break;
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 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
823 else if (combo->type == PURPLE_PREF_STRING) {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
824 gtk_tree_model_get(store, &iter,
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
825 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
826 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
827 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
828 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
829 break;
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 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
832 else if (combo->type == PURPLE_PREF_BOOLEAN) {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
833 gtk_tree_model_get(store, &iter,
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
834 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
835 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
836 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
837 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
838 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
839 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
840 }
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
841 } while (gtk_tree_model_iter_next(store, &iter));
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
842
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
843 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
844
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
845 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
846 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
847 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
848
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
849 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
850 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
851 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
852 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
853
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
854 static void
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
855 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
856 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
857 purple_prefs_set_bool(key,
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
858 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
859 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
860
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
861 GtkWidget *
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
862 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
863 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
864 GtkWidget *button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
865
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
866 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
867 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
868 purple_prefs_get_bool(key));
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
869
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
870 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
871
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
872 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
873 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
874
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
875 gtk_widget_show(button);
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
876
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
877 return button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
878 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
879
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
880 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
881 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
882 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
883 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
884 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
885 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
886 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
887 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
888
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
889 static void keyring_page_cleanup(PidginPrefsWindow *win);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
890
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
891 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
892 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
893 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
894 /* 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
895 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
896
34188
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
897 purple_notify_close_with_handle(prefs);
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
898
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
899 g_clear_object(&prefs->theme.session);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
900
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
901 /* 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
902 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
903
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
904 /* NULL-ify globals */
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 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
906 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
907
6e6f7be71d50 Make sure all globals are NULL when the prefs page is destroyed.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29149
diff changeset
908 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
909 prefs_blist_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
910 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
911 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
912
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
913 keyring_page_cleanup(prefs);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
914
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
915 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
916 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
917 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
918 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
919
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
920 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
921 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
922 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
923 {
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
924
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
925 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
926 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
927 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
928 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
929 }
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
930
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
931 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
932 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
933 {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
934 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
935 GtkTreeIter iter;
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
936 gchar *description;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
937
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
938 description = get_theme_markup(_("none"), FALSE, _("Penguin Pimps"),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
939 _("Selecting this disables graphical emoticons."));
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
940 gtk_list_store_append(prefs_smiley_themes, &iter);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
941 gtk_list_store_set(prefs_smiley_themes, &iter,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
942 0, NULL, 1, description, 2, "none", -1);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
943 g_free(description);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
944
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
945 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
946 PidginSmileyTheme *theme = it->data;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
947
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
948 description = get_theme_markup(
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
949 _(pidgin_smiley_theme_get_name(theme)), FALSE,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
950 _(pidgin_smiley_theme_get_author(theme)),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
951 _(pidgin_smiley_theme_get_description(theme)));
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
952
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
953 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
954 gtk_list_store_set(prefs_smiley_themes, &iter,
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
955 0, pidgin_smiley_theme_get_icon(theme),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
956 1, description,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
957 2, pidgin_smiley_theme_get_name(theme),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
958 -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
959
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
960 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
961 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
962 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
963
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
964 /* 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
965 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
966 pref_sound_generate_markup(void)
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
967 {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
968 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
969 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
970 gchar *name, *markup;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
971 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
972 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
973
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
974 customized = pidgin_sound_is_customized();
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
975 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
976
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
977 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
978 do {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
979 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
980
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
981 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
982
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 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
984 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
985 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
986 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
987 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
988 } else {
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
989 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
990 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
991 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
992 }
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
993
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
994 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
995
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
996 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
997
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
998 g_free(name);
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
999 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
1000
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
1001 } 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
1002 }
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
1003 }
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
1004
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1005 /* 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
1006 static void
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1007 prefs_themes_sort(PurpleTheme *theme)
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1008 {
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
1009 GdkPixbuf *pixbuf = NULL;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1010 GtkTreeIter iter;
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
1011 gchar *image_full = NULL, *markup;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1012 const gchar *name, *author, *description;
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1013
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1014 if (PURPLE_IS_SOUND_THEME(theme)){
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1015
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
1016 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
1017 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
1018 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
1019 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
1020 } 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
1021 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
1022
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1023 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
1024 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
1025
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
1026 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
1027 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
1028
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1029 } 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
1030 GtkListStore *store;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1031
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1032 if (PIDGIN_IS_BLIST_THEME(theme))
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1033 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
1034 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
1035 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
1036
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 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
1038 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
1039 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
1040 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
1041 } 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
1042 pixbuf = NULL;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1043
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1044 name = purple_theme_get_name(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1045 author = purple_theme_get_author(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1046 description = purple_theme_get_description(theme);
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1047
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
1048 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
1049
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1050 gtk_list_store_append(store, &iter);
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
1051 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
1052
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
1053 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
1054 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
1055 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
1056
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1057 }
23648
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
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1060 static void
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1061 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
1062 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1063 GtkTreeIter iter;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1064 gchar *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1065 gboolean unset = TRUE;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1066
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1067 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
1068 do {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1069 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
1070
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
1071 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
1072 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
1073 unset = FALSE;
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
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1076 g_free(theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1077 } 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
1078 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1079
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1080 if (unset)
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1081 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
1082 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1083
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1084 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1085 prefs_themes_refresh(void)
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1086 {
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1087 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
1088 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
1089 GtkTreeIter iter;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1090
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
1091 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
1092 /* 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
1093 purple_theme_manager_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1094
35850
1abeda205d6c cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35748
diff changeset
1095 tmp = g_build_filename(PURPLE_DATADIR, "icons", "hicolor", "32x32",
39856
cd8bea4a8ca8 Rename app icon using reverse domain.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39781
diff changeset
1096 "apps", "im.pidgin.Pidgin3.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
1097 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
1098 g_free(tmp);
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1099
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
1100 /* sound themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1101 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
1102 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
1103 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
1104
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
1105 /* blist themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1106 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
1107 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
1108 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
1109 _("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
1110 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
1111 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
1112
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1113 /* status icon themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1114 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
1115 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
1116 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
1117 _("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
1118 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
1119 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
1120 if (pixbuf)
48c271584931 Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <datallah@pidgin.im>
parents: 28627
diff changeset
1121 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
1122
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
1123 /* smiley themes */
953b76a4cca7 Convert Smiley theme selection to the simpler combo box affair that's in
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28893
diff changeset
1124 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
1125
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1126 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
1127 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
1128 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
1129
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1130 /* set active */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1131 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
1132 prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme"));
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1133 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
1134 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
1135 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
1136 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1137
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1138 /* 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
1139 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1140 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
1141 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1142 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
1143
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1144 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
1145
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1146 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
1147
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
1148 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
1149 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1150
35455
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1151 /*
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1152 * prefs_theme_find_theme:
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1153 * @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
1154 * 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
1155 * @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
1156 * 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
1157 * "theme."
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1158 *
33562
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1159 * 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
1160 * 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
1161 * load each subdirectory that we encounter.
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1162 *
35455
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1163 * Returns: A new reference to a #PurpleTheme.
33562
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1164 */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1165 static PurpleTheme *
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1166 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
1167 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1168 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
1169 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
1170 const gchar *next;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1171
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1172 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
1173 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
1174
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1175 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
1176 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
1177
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1178 g_free(next_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1179 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1180
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1181 g_dir_close(dir);
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 return theme;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1184 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1185
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
1186 /* 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
1187 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
1188 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
1189 {
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1190 FILE *src, *dest;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1191 gint chr = EOF;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1192
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1193 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
1194 return FALSE;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1195 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
1196 fclose(src);
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1197 return FALSE;
27451
6dcd55e2c594 Handle dest failing to open properly by closing the src handle.
Paul Aurich <darkrain42@pidgin.im>
parents: 27450
diff changeset
1198 }
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
1199
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1200 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
1201 fputc(chr, dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1202 }
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1203
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1204 fclose(dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1205 fclose(src);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1206
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1207 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
1208 }
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1209
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1210 static void
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1211 free_theme_info(struct theme_info *info)
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1212 {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1213 if (info != NULL) {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1214 g_free(info->type);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1215 g_free(info->extension);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1216 g_free(info->original_name);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1217 g_free(info);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1218 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1219 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1220
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1221 /* 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
1222 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1223 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
1224 {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1225 gchar *destdir;
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1226 const char *tail;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1227 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
1228 PurpleTheme *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1229
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1230 if (info == NULL)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1231 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1232
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1233 /* check the extension */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1234 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
1235
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1236 if (!tail) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1237 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
1238 return;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
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
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1241 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
1242
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1243 /* Just to be safe */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1244 g_strchomp(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1245
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
1246 if ((is_smiley_theme = purple_strequal(info->type, "smiley")))
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1247 destdir = g_build_filename(purple_data_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
1248 else
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1249 destdir = g_build_filename(purple_data_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
1250
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1251 /* 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
1252 * 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
1253 if (is_archive) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1254 #ifndef _WIN32
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1255 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
1256 gchar *destdir_escaped = g_shell_quote(destdir);
39918
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39856
diff changeset
1257 gchar *command;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1258
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1259 if (!g_file_test(destdir, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1260 g_mkdir_with_parents(destdir, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1261 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1262
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1263 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
1264 g_free(path_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1265 g_free(destdir_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1266
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1267 /* Fire! */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1268 if (system(command)) {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1269 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
1270 g_free(command);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1271 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1272 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
1273 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1274 }
39918
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39856
diff changeset
1275 g_free(command);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1276 #else
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1277 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
1278 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
1279 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1280 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
1281 return;
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 #endif
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1284 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1285
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1286 if (is_smiley_theme) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1287 /* 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
1288 prefs_themes_refresh();
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1289
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1290 } else if (is_archive) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1291 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
1292
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1293 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
1294 /* create the location for the theme */
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1295 gchar *theme_dest = g_build_filename(purple_data_dir(), "themes",
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1296 purple_theme_get_name(theme),
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1297 "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
1298
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1299 if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1300 g_mkdir_with_parents(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1301 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1302
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1303 g_free(theme_dest);
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1304 theme_dest = g_build_filename(purple_data_dir(), "themes",
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1305 purple_theme_get_name(theme),
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1306 "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
1307
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1308 /* 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
1309 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
1310 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
1311 "%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
1312 g_strerror(errno));
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1313 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1314
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1315 g_free(theme_dest);
36029
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1316 if (g_remove(destdir) != 0) {
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1317 purple_debug_error("gtkprefs",
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1318 "couldn't remove temp (dest) path\n");
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1319 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1320 g_object_unref(theme);
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 prefs_themes_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1323
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1324 } else {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1325 /* 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
1326 g_unlink(destdir);
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1327 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
1328 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1329
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1330 } 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
1331 gchar *temp_path, *temp_file;
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1332
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1333 temp_path = g_build_filename(purple_data_dir(), "themes", "temp",
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1334 "sub_folder", NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1335
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1336 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
1337 /* 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
1338 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
1339
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1340 } 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
1341 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
1342 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
1343 g_free(source_name);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1344 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1345
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1346 if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1347 g_mkdir_with_parents(temp_path, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1348 }
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
1349
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1350 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
1351 /* find the theme, could be in subfolder */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1352 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
1353
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 if (PURPLE_IS_THEME(theme)) {
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1355 gchar *theme_dest =
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1356 g_build_filename(purple_data_dir(), "themes",
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1357 purple_theme_get_name(theme), "purple",
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1358 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
1359
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1360 if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1361 g_mkdir_with_parents(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1362 }
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
1363
33563
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1364 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
1365 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
1366 "%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
1367 g_strerror(errno));
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1368 }
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
1369
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 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
1371 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
1372
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 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
1374 } else {
35991
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1375 if (g_remove(temp_path) != 0) {
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1376 purple_debug_error("gtkprefs",
36002
31a8779e91d4 Merge release-2.x.y
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35989 35991
diff changeset
1377 "couldn't remove temp path");
35991
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1378 }
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1379 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
1380 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1381 } else {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1382 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
1383 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1384
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1385 g_free(temp_file);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1386 g_free(temp_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1387 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1388
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1389 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1390 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
1391 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1392
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1393 static void
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1394 theme_got_url(G_GNUC_UNUSED SoupSession *session, SoupMessage *msg,
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1395 gpointer _info)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1396 {
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1397 struct theme_info *info = _info;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1398 FILE *f;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1399 gchar *path;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1400 size_t wc;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1401
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1402 if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) {
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1403 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
1404 return;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1405 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1406
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1407 f = purple_mkstemp(&path, TRUE);
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1408 wc = fwrite(msg->response_body->data, msg->response_body->length, 1, f);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1409 if (wc != 1) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1410 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
1411 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1412 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1413 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
1414 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
1415 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1416 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1417 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1418
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1419 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
1420
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1421 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1422 g_free(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1423 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1424
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1425 static void
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1426 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
1427 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
1428 {
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
1429 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
1430
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
1431 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
1432 && (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
1433 /* 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
1434 * 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
1435 gchar *temp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1436 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
1437 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
1438 info->extension = g_strdup(g_strrstr(name,"."));
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1439 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
1440 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
1441
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1442 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
1443 GError *converr = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1444 gchar *tmp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1445 /* 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
1446 * 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
1447 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
1448 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
1449 (converr ? converr->message :
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1450 "g_filename_from_uri error"));
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1451 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
1452 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1453 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1454 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
1455 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
1456 } 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
1457 !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
1458 /* 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
1459 * will start to get interesting */
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1460 SoupMessage *msg;
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1461
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1462 if (prefs->theme.session == NULL) {
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1463 prefs->theme.session = soup_session_new();
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1464 }
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1465
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1466 soup_session_abort(prefs->theme.session);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1467
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1468 msg = soup_message_new("GET", name);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1469 // purple_http_request_set_max_len(msg, PREFS_MAX_DOWNLOADED_THEME_SIZE);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1470 soup_session_queue_message(prefs->theme.session, msg, theme_got_url,
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1471 info);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1472 } else
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1473 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
1474
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1475 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
1476 }
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1477
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1478 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
1479 }
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1480
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1481 /* builds a theme combo box from a list store with colums: icon preview, markup, theme name */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1482 static void
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1483 prefs_build_theme_combo_box(GtkWidget *combo_box, GtkListStore *store,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1484 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
1485 {
28483
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1486 GtkTargetEntry te[3] = {
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1487 {"text/plain", 0, 0},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1488 {"text/uri-list", 0, 1},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1489 {"STRING", 0, 2}
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1490 };
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1491
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1492 g_return_if_fail(store != NULL && current_theme != NULL);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1493
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1494 gtk_combo_box_set_model(GTK_COMBO_BOX(combo_box),
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1495 GTK_TREE_MODEL(store));
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
1496
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1497 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
1498 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
1499
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1500 g_signal_connect(G_OBJECT(combo_box), "drag_data_received", G_CALLBACK(theme_dnd_recv), (gpointer) type);
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1501 }
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1502
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
1503 /* 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
1504 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
1505 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
1506 {
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
1507 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(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
1508 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
1509 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
1510 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
1511 GtkTreeIter new_iter;
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
1512
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
1513 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
1514
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1515 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
1516
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1517 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
1518
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1519 /* 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
1520 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
1521 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
1522 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
1523 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
1524 g_free(pref);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1525 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1526
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1527 /* 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
1528 pref_sound_generate_markup();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1529
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
1530 gtk_entry_set_text(GTK_ENTRY(win->sound.entry), _("(default)"));
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1531
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1532 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
1533 }
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 }
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
1535
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
1536 /* 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
1537 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
1538 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
1539 {
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
1540 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
1541 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
1542
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
1543 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
1544
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
1545 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
1546
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
1547 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
1548
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
1549 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
1550 }
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
1551 }
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
1552
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1553
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1554 /* 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
1555 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
1556 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
1557 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
1558 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
1559 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1560 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
1561 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
1562
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
1563 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
1564 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
1565
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1566 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
1567 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
1568 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
1569 } 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
1570 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
1571 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
1572 else
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1573 /* 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
1574 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
1575 } 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
1576 /* 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
1577 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
1578 } 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
1579 /* 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
1580 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
1581 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1582
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1583 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
1584 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
1585
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1586 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
1587 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1588
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
1589 /* 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
1590 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
1591 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
1592 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1593 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
1594 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
1595 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
1596
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1597 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
1598
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1599 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
1600
38265
ee28d52fe2ca Use conventional style for empty string check
qarkai <qarkai@gmail.com>
parents: 38262
diff changeset
1601 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
1602 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
1603
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1604 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
1605
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1606 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
1607 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1608 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1609
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1610 /* 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
1611 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
1612 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
1613 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1614 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
1615 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
1616 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
1617
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1618 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
1619
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 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
1621
38265
ee28d52fe2ca Use conventional style for empty string check
qarkai <qarkai@gmail.com>
parents: 38262
diff changeset
1622 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
1623 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
1624
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 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
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 pidgin_stock_load_status_icon_theme(theme);
39665
2172e3b8eeef Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39317
diff changeset
1628 pidgin_blist_refresh(purple_blist_get_default());
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
1629 }
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 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1631
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1632 static void
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1633 bind_theme_page(PidginPrefsWindow *win)
30722
375497ecb944 Reduce some code duplication in the Prefs dialog creation function.
Gabriel Schulhof <nix@go-nix.ca>
parents: 30622
diff changeset
1634 {
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
1635 /* Buddy List Themes */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1636 prefs_build_theme_combo_box(win->theme.blist, prefs_blist_themes,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1637 PIDGIN_PREFS_ROOT "/blist/theme", "blist");
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1638 prefs_blist_themes_combo_box = win->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
1639
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1640 /* Status Icon Themes */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1641 prefs_build_theme_combo_box(win->theme.status, prefs_status_icon_themes,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1642 PIDGIN_PREFS_ROOT "/status/icon-theme",
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1643 "icon");
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1644 prefs_status_themes_combo_box = win->theme.status;
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
1645
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
1646 /* Sound Themes */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1647 prefs_build_theme_combo_box(win->theme.sound, prefs_sound_themes,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1648 PIDGIN_PREFS_ROOT "/sound/theme", "sound");
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1649 prefs_sound_themes_combo_box = win->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
1650
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
1651 /* Smiley Themes */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1652 prefs_build_theme_combo_box(win->theme.smiley, prefs_smiley_themes,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1653 PIDGIN_PREFS_ROOT "/smileys/theme",
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1654 "smiley");
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1655 prefs_smiley_themes_combo_box = win->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
1656
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1657 /* 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
1658 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
1659 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
1660 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
1661 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
1662 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1663
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1664 static void
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1665 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
1666 {
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1667 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
1668 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
1669 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
1670 activated);
39267
0e4718ab2f9b remove a stray tab
Gary Kramlich <grim@reaperworld.com>
parents: 39266
diff changeset
1671 } 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
1672 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
1673 activated);
39268
82cdabe4bd2f remove more stray tabs
Gary Kramlich <grim@reaperworld.com>
parents: 39267
diff changeset
1674 } 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
1675 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
1676 activated);
39268
82cdabe4bd2f remove more stray tabs
Gary Kramlich <grim@reaperworld.com>
parents: 39267
diff changeset
1677 } 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
1678 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
1679 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
1680 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1681 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1682
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1683 static void
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1684 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
1685 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1686 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
1687
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1688 /* System Tray */
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1689 win->iface.docklet.type = PURPLE_PREF_STRING;
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1690 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
1691 pidgin_prefs_bind_dropdown(&win->iface.docklet);
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1692
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1693 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
1694 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
1695 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
1696
27592
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1697 #ifdef _WIN32
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1698 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
1699 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
1700 #else
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1701 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
1702 #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
1703
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1704 /* All the tab options! */
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1705 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
1706 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
1707
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1708 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1709 * 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
1710 * 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
1711 */
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1712 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
1713 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
1714 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
1715
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1716 pidgin_prefs_bind_checkbox(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1717 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
1718 win->iface.conversations.close_on_tabs);
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1719
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1720 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
1721 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
1722 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
1723
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1724 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
1725 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
1726 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
1727 pidgin_prefs_bind_dropdown_from_list(
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1728 &win->iface.conversations.placement,
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1729 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
1730 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
1731 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1732
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1733 /* 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
1734 static void
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1735 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
1736 {
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
1737 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
1738 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
1739 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
1740 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
1741 }
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
1742
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1743 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
1744 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
1745 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
1746
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
1747 }
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1748
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
1749 static void
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1750 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
1751 {
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
1752
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1753 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
1754 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
1755
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1756 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
1757 }
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1758
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1759 static void
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1760 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
1761 {
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1762 GSimpleActionGroup *ag = NULL;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1763
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1764 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
1765 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
1766 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
1767
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1768 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
1769 win->conversations.show_incoming_formatting);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1770 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
1771 win->conversations.im.close_immediately);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1772
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1773 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
1774 win->conversations.im.show_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1775 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
1776 win->conversations.im.animate_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1777 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
1778 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
1779 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
1780
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1781 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
1782 win->conversations.im.send_typing);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1783 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
1784 win->conversations.spellcheck);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1785
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1786 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
1787 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
1788
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1789 #ifdef _WIN32
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1790 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
1791 win->conversations.win32.blink_im);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1792 #else
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1793 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
1794 #endif
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1795
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1796 #if 0
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1797 /* TODO: it's not implemented */
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1798 pidgin_prefs_bind_checkbox(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1799 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
1800 win->conversations.resize_custom_smileys);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1801
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1802 pidgin_prefs_bind_spin_button(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1803 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
1804 win->conversations.custom_smileys_size);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1805
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1806 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
1807 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
1808 G_BINDING_SYNC_CREATE);
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1809 #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
1810
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1811 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
1812 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
1813 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
1814
29656
2dfea274d539 Fix the Windows font pref for the new GTK version requirements.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 29655
diff changeset
1815 #ifdef _WIN32
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1816 {
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1817 const char *font_name;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1818 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
1819
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1820 pidgin_prefs_bind_checkbox(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1821 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
1822 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
1823
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
1824 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
1825 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
1826 gtk_font_chooser_set_font(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1827 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
1828 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
1829 }
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
1830
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1831 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
1832 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
1833 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
1834 }
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
1835 #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
1836
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1837 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
1838 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
1839 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
1840 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1841
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1842 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1843 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
1844 {
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
1845 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
1846 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
1847
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
1848 if (text && *text) {
39987
9aea69045c1f Replace purple_ip*_address_is_valid by GLib functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39955
diff changeset
1849 if (g_hostname_is_ip_address(text)) {
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
1850 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
1851 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
1852 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
1853 } else {
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1854 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
1855 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
1856 }
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
1857
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
1858 } 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
1859 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
1860 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
1861 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
1862 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1863 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1864
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1865 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1866 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
1867 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
1868 {
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
1869 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
1870 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
1871 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
1872 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
1873
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
1874 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
1875 }
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
1876
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1877 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1878 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
1879 GdkEventFocus *event, gpointer data)
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1880 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1881 GtkEntry *entry = GTK_ENTRY(widget);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1882 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
1883 gtk_entry_get_text(entry));
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1884 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
1885
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1886 return FALSE;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1887 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1888
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1889 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
1890 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
1891 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
1892 {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1893 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
1894 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
1895
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
1896 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
1897 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
1898 else
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1899 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
1900 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1901
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1902 static void
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1903 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
1904 {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1905 if (entry == win->proxy.host) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1906 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
1907 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
1908 } else if (entry == win->proxy.port) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1909 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
1910 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
1911 GTK_SPIN_BUTTON(entry)));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1912 } else if (entry == win->proxy.username) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1913 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
1914 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
1915 } else if (entry == win->proxy.password) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1916 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
1917 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
1918 }
22419
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 static void
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1922 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
1923 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1924 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
1925
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1926 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
1927 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
1928
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1929 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
1930 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
1931 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1932
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1933 static void
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
1934 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
1935 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1936 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
1937
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
1938 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
1939 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
1940
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1941 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
1942 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
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
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
1945 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
1946 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
1947 {
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
1948 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
1949 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
1950 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
1951
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
1952 /* 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
1953 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
1954 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
1955
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
1956 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
1957 /* 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
1958 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
1959 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
1960 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
1961 } 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
1962 /* 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
1963 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
1964 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
1965 /* 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
1966 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
1967 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
1968 /* 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
1969 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
1970 }
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
1971 }
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
1972 }
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
1973 }
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
1974 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
1975 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
1976
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
1977 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
1978 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
1979 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
1980 }
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
1981
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1982 static void
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1983 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
1984 {
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1985 GtkStyleContext *context;
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1986 GtkCssProvider *ip_css;
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1987 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
1988 ".bad-ip {"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1989 "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
1990 "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
1991 "background-image: none;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1992 "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
1993 "}"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1994 ".good-ip {"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1995 "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
1996 "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
1997 "background-image: none;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1998 "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
1999 "}";
22419
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
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2001 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
2002 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
2003
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2004 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
2005 win->network.auto_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2006 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
2007
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2008 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
2009 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
2010
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
2011 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
2012 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
2013 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
2014 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
2015 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
2016 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
2017
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2018 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
2019 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
2020 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
2021
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2022 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
2023 win->network.map_ports);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2024
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2025 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
2026 win->network.ports_range_use);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2027 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
2028 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
2029 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
2030
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2031 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
2032 win->network.ports_range_start);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2033 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
2034 win->network.ports_range_end);
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2035
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
2036 /* TURN server */
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2037 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
2038 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
2039
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2040 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
2041 win->network.turn_port_udp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2042
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2043 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
2044 win->network.turn_port_tcp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2045
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2046 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
2047 win->network.turn_username);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2048 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
2049 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
2050 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2051
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2052 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2053 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
2054 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2055 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
2056
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
2057 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
2058
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2059 /* 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
2060 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
2061 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2062
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2063 #ifndef _WIN32
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2064 static GList *
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2065 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
2066 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2067 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
2068 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
2069 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
2070 };
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2071
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2072 /* 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
2073 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
2074 {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
2075 {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
2076 {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
2077 {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
2078 {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
2079 /* 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
2080 * 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
2081 {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
2082 {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
2083 {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
2084 {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
2085 {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
2086 {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
2087 /* 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
2088 {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
2089 /* 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
2090 {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
2091 };
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2092 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
2093
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2094 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
2095 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
2096 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
2097
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2098 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
2099 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
2100
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2101 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
2102 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
2103 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
2104 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
2105 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
2106 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
2107 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
2108 /* 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
2109 if(purple_strequal(possible_browsers[i].command, "xdg-open")) {
38260
dcada91c0912 Remove redundant NULL checks
qarkai <qarkai@gmail.com>
parents: 38259
diff changeset
2110 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
2111 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
2112 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
2113 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2114 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
2115 }
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 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2117 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2118
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2119 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
2120 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
2121
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2122 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
2123 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2124
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2125 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
2126 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
2127 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
2128 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2129 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
2130 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
2131
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
2132 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
2133 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2134
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2135 static void
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2136 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
2137 gconstpointer value, gpointer data)
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2138 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2139 GtkWidget *hbox = data;
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2140 const char *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
2141
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
2142 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
2143 }
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2144 #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
2145
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2146 static void
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2147 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
2148 {
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2149 #ifdef _WIN32
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2150 /* We use the registered default browser in windows */
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2151 gtk_widget_hide(win->browser.page);
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2152 return;
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2153 #else
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2154 /* if the user is running Mac OS X, hide the browsers tab */
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2155 if (purple_running_osx()) {
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2156 gtk_widget_hide(win->browser.page);
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2157 } else if (purple_running_gnome()) {
32093
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2158 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
2159
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2160 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
2161 "gnome");
28894
ce2f7d76f26d Show the Configure Proxy and Configure Browser buttons if the relevant GNOME
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28893
diff changeset
2162
32093
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2163 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
2164 if (path != NULL) {
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2165 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
2166 g_free(path);
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2167 path = tmp;
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2168 } else {
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2169 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
2170 }
32c90aed652c *** Plucked rev deb06ab6aa118efb674f1a8434ff529e67b28809 (qulogic@pidgin.im):
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32079
diff changeset
2171
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2172 win->browser.gnome_program_path = path;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2173 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
2174 path == NULL);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2175 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
2176 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
2177 } else {
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2178 GList *browsers = NULL;
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2179
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2180 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
2181 "nongnome");
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2182
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2183 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
2184 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
2185 browsers = get_available_browsers();
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2186 pidgin_prefs_bind_dropdown_from_list(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2187 &win->browser.browser,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2188 browsers);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2189 g_list_free(browsers);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2190
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2191 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
2192 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
2193 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
2194
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2195 purple_prefs_connect_callback(prefs,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2196 PIDGIN_PREFS_ROOT "/browsers/browser",
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2197 browser_changed1_cb,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2198 win->browser.place_hbox);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2199
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2200 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
2201 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
2202 purple_prefs_connect_callback(prefs,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2203 PIDGIN_PREFS_ROOT "/browsers/browser",
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2204 browser_changed2_cb,
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2205 win->browser.manual_command_hbox);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2206
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2207 if (purple_strequal(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2208 purple_prefs_get_string(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2209 PIDGIN_PREFS_ROOT "/browsers/browser"),
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2210 "custom")) {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2211 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
2212 FALSE);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2213 } else {
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
2214 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
2215 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
2216 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2217 }
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2218 #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
2219 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2220
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2221 static void
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2222 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
2223 {
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2224 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
2225
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
2226 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
2227 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
2228
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2229 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
2230 "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
2231
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
2232 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
2233 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
2234 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
2235 if (path == NULL) {
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2236 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
2237 if (path != NULL) {
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2238 char *tmp = g_strdup_printf("%s network", path);
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2239 g_free(path);
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2240 path = tmp;
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2241 }
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
2242 }
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
2243
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2244 win->proxy.gnome_program_path = path;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2245 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
2246 path == NULL);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2247 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
2248 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
2249 } else {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2250 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
2251 "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
2252
28891
6502040769d4 Silence some assertions QuLogic noticed.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28890
diff changeset
2253 /* 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
2254 * account-specific proxy settings */
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2255 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
2256 win->proxy.socks4_remotedns);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2257
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2258 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
2259 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
2260 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
2261 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
2262
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
2263 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
2264 proxy_changed_cb, win);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2265
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2266 if (proxy_info != NULL) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2267 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
2268 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
2269 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
2270 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2271
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2272 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
2273 gtk_spin_button_set_value(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2274 GTK_SPIN_BUTTON(win->proxy.port),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2275 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
2276 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2277
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2278 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
2279 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
2280 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
2281 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2282
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2283 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
2284 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
2285 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
2286 }
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
2287 }
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
2288
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
2289 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
2290 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
2291 win);
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2292 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2293 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
2294
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2295 static void
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2296 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
2297 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2298 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
2299
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2300 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
2301 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
2302 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
2303 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
2304 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
2305
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2306 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
2307 win->logging.log_ims);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2308 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
2309 win->logging.log_chats);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2310 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
2311 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
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
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2314 /*** keyring page *******************************************************/
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2315
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2316 static void
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2317 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
2318 {
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2319 PurpleRequestField *setting = _setting;
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2320 PurpleRequestFieldType field_type;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2321
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2322 gtk_widget_set_sensitive(prefs->keyring.apply, TRUE);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2323
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
2324 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
2325
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2326 if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2327 purple_request_field_bool_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2328 gtk_toggle_button_get_active(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2329 GTK_TOGGLE_BUTTON(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2330 } else if (field_type == PURPLE_REQUEST_FIELD_STRING) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2331 purple_request_field_string_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2332 gtk_entry_get_text(GTK_ENTRY(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2333 } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2334 purple_request_field_int_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2335 gtk_spin_button_get_value_as_int(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2336 GTK_SPIN_BUTTON(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2337 } else
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2338 g_return_if_reached();
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2339 }
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2340
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2341 static void
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2342 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
2343 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
2344 {
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2345 GtkWidget *widget;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2346 PurpleRequestFieldType field_type;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2347 const gchar *label;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2348
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2349 label = purple_request_field_get_label(setting);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2350
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
2351 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
2352 if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2353 widget = gtk_check_button_new_with_label(label);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2354 label = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2355 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
2356 purple_request_field_bool_get_value(setting));
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2357 g_signal_connect(G_OBJECT(widget), "toggled",
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2358 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
2359 } 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
2360 widget = gtk_entry_new();
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2361 gtk_entry_set_text(GTK_ENTRY(widget),
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2362 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
2363 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
2364 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
2365 g_signal_connect(G_OBJECT(widget), "changed",
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2366 G_CALLBACK(keyring_page_settings_changed), setting);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2367 } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2368 widget = gtk_spin_button_new_with_range(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2369 purple_request_field_int_get_lower_bound(setting),
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2370 purple_request_field_int_get_upper_bound(setting), 1);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2371 gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2372 purple_request_field_int_get_value(setting));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2373 g_signal_connect(G_OBJECT(widget), "value-changed",
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2374 G_CALLBACK(keyring_page_settings_changed), setting);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2375 } else {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2376 purple_debug_error("gtkprefs", "Unsupported field type\n");
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2377 return;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2378 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2379
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2380 pidgin_add_widget_to_vbox(vbox, label, sg, widget, FALSE, NULL);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2381 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2382
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2383 /* XXX: it could be available for all plugins, not keyrings only */
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2384 static void
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2385 keyring_page_add_settings(PidginPrefsWindow *win)
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2386 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2387 GtkWidget *box;
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2388 GList *it, *groups;
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2389 GtkSizeGroup *sg;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2390
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2391 box = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_BOX_SPACE);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2392 gtk_box_pack_start(GTK_BOX(win->keyring.vbox), box, FALSE, FALSE, 0);
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2393
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2394 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2395
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2396 groups = purple_request_fields_get_groups(win->keyring.settings);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2397 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
2398 GList *it2, *fields;
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2399 GtkBox *vbox;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2400 PurpleRequestFieldGroup *group;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2401 const gchar *group_title;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2402
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2403 group = it->data;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2404 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
2405 if (group_title) {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2406 vbox = GTK_BOX(pidgin_make_frame(box, group_title));
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2407 } else {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2408 vbox = GTK_BOX(box);
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2409 }
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2410
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2411 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
2412 for (it2 = g_list_first(fields); it2 != NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2413 it2 = g_list_next(it2)) {
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2414 keyring_page_add_settings_field(vbox, it2->data, sg);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2415 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2416 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2417
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2418 g_object_unref(sg);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2419
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2420 win->keyring.settings_box = box;
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2421 }
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2422
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2423 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2424 keyring_page_settings_apply(GtkButton *button, gpointer data)
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2425 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2426 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2427
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2428 if (!purple_keyring_apply_settings(win, win->keyring.settings)) {
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2429 return;
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2430 }
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2431
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2432 gtk_widget_set_sensitive(win->keyring.apply, FALSE);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2433 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2434
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2435 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2436 keyring_page_update_settings(PidginPrefsWindow *win)
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2437 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2438 g_clear_pointer(&win->keyring.settings, purple_request_fields_destroy);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2439 win->keyring.settings = purple_keyring_read_settings();
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2440 if (!win->keyring.settings) {
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2441 return;
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2442 }
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2443
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2444 keyring_page_add_settings(win);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2445
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2446 win->keyring.apply = gtk_button_new_with_mnemonic(_("_Apply"));
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2447 gtk_box_pack_start(GTK_BOX(win->keyring.settings_box),
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2448 win->keyring.apply, FALSE, FALSE, 1);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2449 gtk_widget_set_sensitive(win->keyring.apply, FALSE);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2450 g_signal_connect(G_OBJECT(win->keyring.apply), "clicked",
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2451 G_CALLBACK(keyring_page_settings_apply), win);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2452
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2453 gtk_widget_show_all(win->keyring.settings_box);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2454 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2455
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2456 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2457 keyring_page_pref_set_inuse(GError *error, G_GNUC_UNUSED gpointer unused)
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2458 {
34155
567c48f9658c Refactor the keyring API
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34151
diff changeset
2459 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
2460
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2461 if (prefs == NULL) {
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2462 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
2463 return;
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2464 }
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2465
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2466 gtk_widget_set_sensitive(GTK_WIDGET(prefs->keyring.active.combo), TRUE);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2467
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2468 if (error != NULL) {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2469 pidgin_prefs_bind_dropdown_revert_active(
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2470 &prefs->keyring.active);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2471 purple_notify_error(NULL, _("Keyring"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2472 _("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
2473 return;
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2474 }
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2475
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2476 g_return_if_fail(in_use != NULL);
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2477 purple_prefs_set_string("/purple/keyring/active",
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2478 purple_keyring_get_id(in_use));
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2479
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2480 keyring_page_update_settings(prefs);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2481 }
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2482
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2483 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2484 keyring_page_pref_changed(GtkComboBox *combo_box, PidginPrefCombo *combo)
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2485 {
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2486 const char *keyring_id;
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34023
diff changeset
2487 PurpleKeyring *keyring;
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2488
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2489 g_return_if_fail(combo_box != NULL);
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2490
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2491 keyring_id = combo->value.string;
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2492 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
2493 if (keyring == NULL) {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2494 pidgin_prefs_bind_dropdown_revert_active(combo);
34120
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2495 purple_notify_error(NULL, _("Keyring"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2496 _("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
2497 return;
34120
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2498 }
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2499
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2500 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
2501
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2502 g_clear_pointer(&prefs->keyring.settings_box, gtk_widget_destroy);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2503 g_clear_pointer(&prefs->keyring.settings,
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2504 purple_request_fields_destroy);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2505
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2506 purple_keyring_set_inuse(keyring, FALSE, keyring_page_pref_set_inuse,
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2507 NULL);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2508 }
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2509
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2510 static void
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2511 keyring_page_cleanup(PidginPrefsWindow *win)
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2512 {
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2513 g_clear_pointer(&win->keyring.settings, purple_request_fields_destroy);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2514 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2515
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2516 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2517 bind_keyring_page(PidginPrefsWindow *win)
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
2518 {
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
2519 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
2520
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2521 /* Keyring selection */
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
2522 names = purple_keyring_get_options();
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2523 win->keyring.active.type = PURPLE_PREF_STRING;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2524 win->keyring.active.key = "/purple/keyring/active";
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2525 pidgin_prefs_bind_dropdown_from_list(&win->keyring.active, names);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2526 /* Override the usual callback to defer changing the pref. */
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2527 win->keyring.active.cb = 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
2528 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
2529
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2530 keyring_page_update_settings(win);
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
2531 }
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
2532
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2533 /*** keyring page - end *************************************************/
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2534
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2535 static gboolean
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2536 sound_method_filter(GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2537 {
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2538 gboolean any = FALSE;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2539 gboolean gstreamer = FALSE;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2540 gboolean win32 = FALSE;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2541
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2542 gtk_tree_model_get(model, iter, 2, &any, 3, &gstreamer, 4, &win32, -1);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2543
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2544 if (any) {
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2545 return TRUE;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2546 }
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2547
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2548 if (gstreamer) {
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2549 #ifdef USE_GSTREAMER
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2550 #ifdef _WIN32
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2551 return win32;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2552 #else
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2553 return !win32;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2554 #endif
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2555 #else
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2556 return FALSE;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2557 #endif
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2558 }
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2559
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2560 #ifdef _WIN32
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2561 return win32;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2562 #else
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2563 return !win32;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2564 #endif
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2565 }
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2566
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2567 static gint
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2568 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
2569 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2570 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
2571 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
2572 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
2573 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2574
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2575 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
2576 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
2577 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
2578 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2579 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
2580 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
2581
38258
9a6551eba09c Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38256
diff changeset
2582 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
2583 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2584
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2585 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
2586 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
2587 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
2588 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2589 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
2590 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
2591
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
2592 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
2593 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2594
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2595
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2596 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
2597 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
2598 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2599 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
2600 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
2601 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
2602 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
2603
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2604 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
2605 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
2606 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
2607 -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
2608
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2609 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
2610 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
2611
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2612 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
2613 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
2614 -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
2615
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2616 gtk_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
2617 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2618
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2619 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
2620 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
2621 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2622 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
2623 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
2624 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
2625
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2626 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
2627 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
2628
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2629 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
2630 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
2631
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2632 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
2633 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
2634
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2635 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
2636
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2637 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
2638 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
2639
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2640 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
2641 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2642
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2643 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2644 * 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
2645 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2646 static void
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2647 reset_sound(GtkWidget *button, 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
2648 {
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2649 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(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
2650 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
2651
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2652 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
2653 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
2654 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
2655 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
2656
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2657 gtk_entry_set_text(GTK_ENTRY(win->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
2658
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
2659 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
2660 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2661
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2662 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
2663 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
2664 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2665 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
2666 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
2667
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2668 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
2669
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2670 /* 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
2671 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
2672 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
2673 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
2674 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
2675
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2676 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2677 * 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
2678 * 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
2679 */
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2680 if (sound == sound_row_sel)
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2681 gtk_entry_set_text(GTK_ENTRY(prefs->sound.entry), filename);
23652
3204ee69eab2 Fixes the display problems with (option 1) sound themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23649
diff changeset
2682
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
2683 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
2684 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2685
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2686 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2687 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
2688 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2689 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
2690 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
2691
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2692 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
2693 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
2694 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
2695 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
2696
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2697 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
2698 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
2699
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2700 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
2701 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
2702 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
2703 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2704
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2705 static void
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2706 prefs_sound_sel(GtkTreeSelection *sel, gpointer data)
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2707 {
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2708 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2709 GtkTreeModel *model;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2710 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
2711 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
2712 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
2713 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
2714
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2715 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
2716 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
2717
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2718 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
2719 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
2720 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
2721
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2722 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
2723 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
2724 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
2725 g_free(pref);
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2726 if (win->sound.entry) {
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2727 gtk_entry_set_text(GTK_ENTRY(win->sound.entry),
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2728 (file && *file != '\0') ? file
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2729 : _("(default)"));
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2730 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2731 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
2732
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
2733 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
2734 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2735
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2736 static void
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2737 bind_sound_page(PidginPrefsWindow *win)
24267
a0719843109d Add a "Mute sounds" tickybox in Prefs, mirroring Tools/Mute Sounds.
Will Thompson <resiak@pidgin.im>
parents: 23261
diff changeset
2738 {
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2739 GtkTreeModel *model;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2740 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
2741 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
2742 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
2743 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
2744 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
2745 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
2746
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2747 win->sound.method.type = PURPLE_PREF_STRING;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2748 win->sound.method.key = PIDGIN_PREFS_ROOT "/sound/method";
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2749 pidgin_prefs_bind_dropdown(&win->sound.method);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2750 model = gtk_combo_box_get_model(GTK_COMBO_BOX(win->sound.method.combo));
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2751 gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(model), sound_method_filter, NULL, NULL);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2752 gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(model));
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2753
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2754 gtk_widget_set_sensitive(
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2755 win->sound.method_vbox,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2756 !purple_strequal(purple_prefs_get_string(PIDGIN_PREFS_ROOT
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2757 "/sound/method"),
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2758 "none"));
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2759 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2760 sound_changed2_cb,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2761 win->sound.method_vbox);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2762
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2763 gtk_widget_set_sensitive(
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2764 win->sound.command_hbox,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2765 purple_strequal(purple_prefs_get_string(PIDGIN_PREFS_ROOT
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2766 "/sound/method"),
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2767 "custom"));
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2768 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method",
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2769 sound_changed1_cb,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2770 win->sound.command_hbox);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2771
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2772 cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command");
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2773 if (cmd) {
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2774 gtk_entry_set_text(GTK_ENTRY(win->sound.command), cmd);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2775 }
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2776
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2777 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/sound/mute",
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2778 win->sound.mute);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2779
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2780 pidgin_prefs_bind_checkbox(PIDGIN_PREFS_ROOT "/sound/conv_focus",
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2781 win->sound.conv_focus);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2782
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2783 win->sound.while_status.type = PURPLE_PREF_INT;
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2784 win->sound.while_status.key = "/purple/sound/while_status";
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2785 pidgin_prefs_bind_dropdown(&win->sound.while_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
2786
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
2787 /* 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
2788 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
2789 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
2790 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
2791 const char *label = pidgin_sound_get_event_label(j);
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2792 GtkTreeIter 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
2793
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 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
2795 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
2796 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
2797 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2798
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2799 gtk_list_store_append(win->sound.event.store, &iter);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2800 gtk_list_store_set(win->sound.event.store, &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
2801 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
2802 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
2803 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
2804 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
2805 -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
2806 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
2807 }
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
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2809 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(win->sound.event.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
2810 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
2811 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
2812 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
2813
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 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
2815 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
2816 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
2817 g_free(pref);
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2818 gtk_entry_set_text(GTK_ENTRY(win->sound.entry),
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
2819 (file && *file != '\0') ? file : _("(default)"));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2820 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2821
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2822
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2823 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
2824 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
2825 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2826 purple_prefs_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
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
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 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
2830 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
2831 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2832 purple_prefs_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
2833 }
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
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2835 static void
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2836 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
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 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
2839
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 /* Idle stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2841 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
2842 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
2843 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
2844
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2845 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
2846 win->away.mins_before_away);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2847
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2848 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
2849 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
2850
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 /* 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
2852 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
2853 gtk_widget_show_all(menu);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2854 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
2855
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2856 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
2857 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
2858 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
2859
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
2860 /* Away stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2861 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
2862 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
2863 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
2864
22419
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 /* Signon status stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2866 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
2867 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
2868
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 /* 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
2870 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
2871 gtk_widget_show_all(menu);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2872 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
2873 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
2874 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
2875 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
2876 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
2877 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
2878 }
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
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
2880 #ifdef USE_VV
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2881 static GList *
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2882 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
2883 {
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2884 GList *result = NULL;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2885 GList *i;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2887 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
2888 type);
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2889 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
2890 PurpleMediaElementInfo *info = i->data;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2891
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2892 result = g_list_append(result,
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2893 purple_media_element_info_get_name(info));
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2894 result = g_list_append(result,
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2895 purple_media_element_info_get_id(info));
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2896 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
2897 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2898
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2899 return result;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2900 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2901
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2902 static GstElement *
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2903 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
2904 {
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2905 PurpleMediaElementInfo *element_info;
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2906
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2907 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
2908
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2909 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
2910
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2911 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
2912 NULL, NULL, NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2913 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2914
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2915 static void
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2916 vv_test_switch_page_cb(GtkStack *stack, G_GNUC_UNUSED GParamSpec *pspec,
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2917 gpointer data)
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2918 {
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2919 PidginPrefsWindow *win = data;
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2920
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2921 if (!g_str_equal(gtk_stack_get_visible_child_name(stack), "vv")) {
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2922 /* Disable any running test pipelines. */
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2923 gtk_toggle_button_set_active(
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2924 GTK_TOGGLE_BUTTON(win->vv.voice.test), FALSE);
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2925 gtk_toggle_button_set_active(
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2926 GTK_TOGGLE_BUTTON(win->vv.video.test), FALSE);
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2927 }
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2928 }
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2929
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2930 static GstElement *
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2931 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
2932 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2933 GstElement *pipeline;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2934 GstElement *src, *sink;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2935 GstElement *volume;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2936 GstElement *level;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2937 GstElement *valve;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2938
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2939 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
2940
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2941 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
2942 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
2943 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
2944 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
2945 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
2946
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2947 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
2948 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
2949
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2950 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
2951 "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
2952 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
2953 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
2954
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2955 return pipeline;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2956 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2957
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2958 static void
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
2959 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
2960 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2961 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2962 GstElement *volume;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2963
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2964 if (!win->vv.voice.pipeline) {
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
2965 return;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2966 }
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2967
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2968 volume = gst_bin_get_by_name(GST_BIN(win->vv.voice.pipeline), "volume");
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2969 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
2970 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
2971 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2972
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2973 static gdouble
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2974 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
2975 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2976 const GValue *list;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2977 const GValue *value;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2978 gdouble value_db;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2979 gdouble percent;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2980
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2981 list = gst_structure_get_value(gst_message_get_structure(msg), value_name);
33838
3c73956dbeca Ignore some deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33727
diff changeset
2982 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
2983 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
2984 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
2985 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
2986 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
2987 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
2988 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2989
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2990 static gboolean
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
2991 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
2992 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2993 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2994
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2995 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
2996 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
2997
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2998 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
2999 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
3000
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
3001 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
3002 gdouble percent;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3003 gdouble threshold;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3004 GstElement *valve;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3005
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3006 percent = gst_msg_db_to_percent(msg, "rms");
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3007 gtk_progress_bar_set_fraction(
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3008 GTK_PROGRESS_BAR(win->vv.voice.level), percent);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3009
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3010 percent = gst_msg_db_to_percent(msg, "decay");
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3011 threshold = gtk_range_get_value(GTK_RANGE(
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3012 win->vv.voice.threshold)) /
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3013 100.0;
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3014 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
3015 g_object_set(valve, "drop", (percent < threshold), NULL);
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3016 g_object_set(win->vv.voice.level, "text",
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3017 (percent < threshold) ? _("DROP") : " ",
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3018 NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3019 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3020
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3021 g_free(name);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3022 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3023
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3024 return TRUE;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3025 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3026
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3027 static void
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3028 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
3029 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3030 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3031
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3032 if (!win->vv.voice.pipeline) {
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3033 return;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3034 }
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3035
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3036 gst_element_set_state(win->vv.voice.pipeline, GST_STATE_NULL);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3037 g_clear_pointer(&win->vv.voice.pipeline, gst_object_unref);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3038 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3039
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3040 static void
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3041 enable_voice_test(PidginPrefsWindow *win)
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3042 {
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3043 GstBus *bus;
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3044
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3045 win->vv.voice.pipeline = create_voice_pipeline();
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3046 bus = gst_pipeline_get_bus(GST_PIPELINE(win->vv.voice.pipeline));
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3047 gst_bus_add_signal_watch(bus);
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3048 g_signal_connect(bus, "message", G_CALLBACK(gst_bus_cb), win);
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3049 gst_object_unref(bus);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3050 }
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3051
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3052 static void
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3053 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
3054 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3055 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3056
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3057 if (gtk_toggle_button_get_active(test)) {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3058 gtk_widget_set_sensitive(win->vv.voice.level, TRUE);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3059 enable_voice_test(win);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3060
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3061 g_signal_connect(win->vv.voice.volume, "value-changed",
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3062 G_CALLBACK(on_volume_change_cb), win);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3063 g_signal_connect(test, "destroy",
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3064 G_CALLBACK(voice_test_destroy_cb), win);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3065 } else {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3066 gtk_progress_bar_set_fraction(
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3067 GTK_PROGRESS_BAR(win->vv.voice.level), 0.0);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3068 gtk_widget_set_sensitive(win->vv.voice.level, FALSE);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3069 g_object_disconnect(win->vv.voice.volume,
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3070 "any-signal::value-changed",
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3071 G_CALLBACK(on_volume_change_cb), win, NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3072 g_object_disconnect(test, "any-signal::destroy",
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3073 G_CALLBACK(voice_test_destroy_cb), win,
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3074 NULL);
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3075 voice_test_destroy_cb(NULL, win);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3076 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3077 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3078
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3079 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
3080 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
3081 {
33622
cd86e355b945 Fix some function arguments, which were the real cause of ce1a071ef316.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33564
diff changeset
3082 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
3083 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3084
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3085 static void
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3086 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
3087 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3088 int value;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3089 char *tmp;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3090
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3091 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
3092 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
3093 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
3094 g_free(tmp);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3095
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3096 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
3097 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3098
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3099 static void
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3100 bind_voice_test(PidginPrefsWindow *win, GtkBuilder *builder)
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3101 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3102 GObject *test;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3103 GObject *label;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3104 GObject *volume;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3105 GObject *threshold;
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3106 char *tmp;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3107
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3108 volume = gtk_builder_get_object(builder, "vv.voice.volume");
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3109 win->vv.voice.volume = GTK_WIDGET(volume);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3110 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
3111 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
3112 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
3113 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
3114
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3115 label = gtk_builder_get_object(builder, "vv.voice.threshold_label");
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3116 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
3117 purple_prefs_get_int("/purple/media/audio/silence_threshold"));
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3118 gtk_label_set_text(GTK_LABEL(label), tmp);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3119 g_free(tmp);
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3120
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3121 threshold = gtk_builder_get_object(builder, "vv.voice.threshold");
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3122 win->vv.voice.threshold = GTK_WIDGET(threshold);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3123 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
3124 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
3125 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
3126 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
3127
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3128 win->vv.voice.level =
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3129 GTK_WIDGET(gtk_builder_get_object(builder, "vv.voice.level"));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3130
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
3131 test = gtk_builder_get_object(builder, "vv.voice.test");
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3132 g_signal_connect(test, "toggled",
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3133 G_CALLBACK(toggle_voice_test_cb), win);
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
3134 win->vv.voice.test = GTK_WIDGET(test);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3135 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
3136
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3137 static GstElement *
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3138 create_video_pipeline(void)
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3139 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3140 GstElement *pipeline;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3141 GstElement *src, *sink;
37616
7ae670e19fb4 Add videoconvert into test video pipeline
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37615
diff changeset
3142 GstElement *videoconvert;
37653
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3143 GstElement *videoscale;
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3144
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3145 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
3146 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
3147 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
3148 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
3149 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
3150
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
3151 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
3152
37653
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3153 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
3154 NULL);
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
3155 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
3156
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3157 return pipeline;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3158 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3159
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3160 static void
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3161 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
3162 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3163 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3164
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3165 if (!win->vv.video.pipeline) {
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3166 return;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3167 }
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3168
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3169 gst_element_set_state(win->vv.video.pipeline, GST_STATE_NULL);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3170 g_clear_pointer(&win->vv.video.pipeline, gst_object_unref);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3171 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3172
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3173 static void
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3174 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
3175 {
39778
46b1141b3662 Drop checks for old GStreamer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3176 if (GST_MESSAGE_TYPE(msg) != GST_MESSAGE_ELEMENT ||
46b1141b3662 Drop checks for old GStreamer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3177 !gst_is_video_overlay_prepare_window_handle_message(msg)) {
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3178 return;
39778
46b1141b3662 Drop checks for old GStreamer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3179 }
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3180
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3181 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
3182 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
3183 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
3184 (gpointer)window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3185
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3186 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
3187 window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3188 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3189
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3190 static void
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3191 enable_video_test(PidginPrefsWindow *win)
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3192 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3193 GstBus *bus;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3194 GdkWindow *window = gtk_widget_get_window(win->vv.video.drawing_area);
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3195 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
3196
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3197 #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
3198 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
3199 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
3200 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3201 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3202 #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
3203 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
3204 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
3205 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3206 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3207 #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
3208 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
3209 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
3210 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3211 #endif
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3212 g_warning("Unsupported GDK backend");
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3213 #if !(defined(GDK_WINDOWING_WIN32) \
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3214 || defined(GDK_WINDOWING_X11) \
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
3215 || 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
3216 # 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
3217 #endif
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3218
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3219 win->vv.video.pipeline = create_video_pipeline();
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3220 bus = gst_pipeline_get_bus(GST_PIPELINE(win->vv.video.pipeline));
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3221 gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL, NULL);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3222 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
3223 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
3224 gst_object_unref(bus);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3225
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3226 gst_element_set_state(GST_ELEMENT(win->vv.video.pipeline),
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3227 GST_STATE_PLAYING);
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3228 }
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3229
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3230 static void
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3231 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
3232 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3233 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3234
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3235 if (gtk_toggle_button_get_active(test)) {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3236 enable_video_test(win);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3237 g_signal_connect(test, "destroy",
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3238 G_CALLBACK(video_test_destroy_cb), win);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3239 } else {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3240 g_object_disconnect(test, "any-signal::destroy",
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3241 G_CALLBACK(video_test_destroy_cb), win,
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3242 NULL);
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3243 video_test_destroy_cb(NULL, win);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3244 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3245 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3246
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3247 static void
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3248 bind_video_test(PidginPrefsWindow *win, GtkBuilder *builder)
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3249 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3250 GtkWidget *video;
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3251 GObject *test;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3252 GdkRGBA color = {0.0, 0.0, 0.0, 1.0};
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3253
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3254 win->vv.video.drawing_area = video = GTK_WIDGET(
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3255 gtk_builder_get_object(builder, "vv.video.test_area"));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3256 gtk_widget_override_background_color(video, GTK_STATE_FLAG_NORMAL,
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3257 &color);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3258
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3259 /* In order to enable client shadow decorations, GtkDialog from GTK+ 3.0
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3260 * uses ARGB visual which by default gets inherited by its child
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3261 * widgets. XVideo adaptors on the other hand often support just depth
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3262 * 24 and rendering video through xvimagesink onto a widget inside a
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3263 * GtkDialog then results in no visible output.
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3264 *
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3265 * This ensures the default system visual of the drawing area doesn't
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3266 * get overridden by the widget's parent.
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3267 */
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3268 gtk_widget_set_visual(video, gdk_screen_get_system_visual(
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3269 gtk_widget_get_screen(video)));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3270
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
3271 test = gtk_builder_get_object(builder, "vv.video.test");
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3272 g_signal_connect(test, "toggled",
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3273 G_CALLBACK(toggle_video_test_cb), win);
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
3274 win->vv.video.test = GTK_WIDGET(test);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3275 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
3276
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3277 static void
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3278 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
3279 gconstpointer value, gpointer data)
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3280 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3281 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3282
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3283 PurpleMediaManager *manager;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3284 PurpleMediaElementInfo *info;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3285
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3286 manager = purple_media_manager_get();
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3287 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
3288 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
3289
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3290 /* Refresh test viewers */
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3291 if (strstr(name, "audio") && win->vv.voice.pipeline) {
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3292 voice_test_destroy_cb(NULL, win);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3293 enable_voice_test(win);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3294 } else if (strstr(name, "video") && win->vv.video.pipeline) {
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3295 video_test_destroy_cb(NULL, win);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3296 enable_video_test(win);
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
3297 }
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3298 }
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3299
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3300 static const char *
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3301 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
3302 {
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3303 if (type & PURPLE_MEDIA_ELEMENT_AUDIO) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3304 if (type & PURPLE_MEDIA_ELEMENT_SRC) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3305 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
3306 } 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
3307 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
3308 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3309 } 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
3310 if (type & PURPLE_MEDIA_ELEMENT_SRC) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3311 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
3312 } 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
3313 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
3314 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3315 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3316
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3317 return NULL;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3318 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3319
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3320 static void
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3321 bind_vv_dropdown(PidginPrefCombo *combo, PurpleMediaElementType element_type)
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3322 {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3323 const gchar *preference_key;
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3324 GList *devices;
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3325
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3326 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
3327 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
3328
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3329 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
3330 (GCompareFunc)strcmp) == NULL)
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3331 {
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3332 GList *next = g_list_next(devices);
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3333 if (next)
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3334 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
3335 }
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3336
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3337 combo->type = PURPLE_PREF_STRING;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3338 combo->key = preference_key;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3339 pidgin_prefs_bind_dropdown_from_list(combo, devices);
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3340 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
3341 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3342
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3343 static void
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3344 bind_vv_frame(PidginPrefsWindow *win, PidginPrefCombo *combo,
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3345 PurpleMediaElementType type)
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3346 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3347 bind_vv_dropdown(combo, type);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3348
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3349 purple_prefs_connect_callback(combo->combo,
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3350 purple_media_type_to_preference_key(type),
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
3351 vv_device_changed_cb, win);
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3352 g_signal_connect_swapped(combo->combo, "destroy",
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3353 G_CALLBACK(purple_prefs_disconnect_by_handle),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3354 combo->combo);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3355
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3356 g_object_set_data(G_OBJECT(combo->combo), "vv_media_type",
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3357 (gpointer)type);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3358 g_object_set_data(G_OBJECT(combo->combo), "vv_combo", combo);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3359 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3360
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3361 static void
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3362 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
3363 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3364 PidginPrefCombo *combo;
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3365 PurpleMediaElementType media_type;
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3366 GtkTreeModel *model;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3367
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3368 combo = g_object_get_data(G_OBJECT(widget), "vv_combo");
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3369 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
3370 "vv_media_type");
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3371
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3372 /* Unbind original connections so we can repopulate the combo box. */
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3373 g_object_disconnect(combo->combo, "any-signal::changed",
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3374 G_CALLBACK(bind_dropdown_set), combo, NULL);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3375 model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo->combo));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3376 gtk_list_store_clear(GTK_LIST_STORE(model));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3377
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3378 bind_vv_dropdown(combo, media_type);
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3379 }
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
3380
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3381 static GtkWidget *
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3382 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
3383 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3384 GtkBuilder *builder;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3385 GtkWidget *ret;
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3386 PurpleMediaManager *manager;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3387
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3388 builder = gtk_builder_new_from_resource("/im/pidgin/Pidgin/Prefs/vv.ui");
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3389 gtk_builder_set_translation_domain(builder, PACKAGE);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3390
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3391 ret = GTK_WIDGET(gtk_builder_get_object(builder, "vv.page"));
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3392
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3393 manager = purple_media_manager_get();
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3394
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3395 win->vv.voice.input.combo = GTK_WIDGET(
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3396 gtk_builder_get_object(builder, "vv.voice.input.combo"));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3397 bind_vv_frame(win, &win->vv.voice.input,
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3398 PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SRC);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3399 g_signal_connect_object(manager, "elements-changed::audiosrc",
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3400 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3401 win->vv.voice.input.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3402
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3403 win->vv.voice.output.combo = GTK_WIDGET(
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3404 gtk_builder_get_object(builder, "vv.voice.output.combo"));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3405 bind_vv_frame(win, &win->vv.voice.output,
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3406 PURPLE_MEDIA_ELEMENT_AUDIO | PURPLE_MEDIA_ELEMENT_SINK);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3407 g_signal_connect_object(manager, "elements-changed::audiosink",
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3408 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3409 win->vv.voice.output.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3410
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3411 bind_voice_test(win, builder);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3412
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3413 win->vv.video.input.combo = GTK_WIDGET(
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3414 gtk_builder_get_object(builder, "vv.video.input.combo"));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3415 bind_vv_frame(win, &win->vv.video.input,
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3416 PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SRC);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3417 g_signal_connect_object(manager, "elements-changed::videosrc",
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3418 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3419 win->vv.video.input.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3420
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3421 win->vv.video.output.combo = GTK_WIDGET(
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3422 gtk_builder_get_object(builder, "vv.video.output.combo"));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3423 bind_vv_frame(win, &win->vv.video.output,
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3424 PURPLE_MEDIA_ELEMENT_VIDEO | PURPLE_MEDIA_ELEMENT_SINK);
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
3425 g_signal_connect_object(manager, "elements-changed::videosink",
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3426 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3427 win->vv.video.output.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3428
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3429 bind_video_test(win, builder);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3430
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
3431 g_signal_connect(win->stack, "notify::visible-child",
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
3432 G_CALLBACK(vv_test_switch_page_cb), win);
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
3433
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3434 g_object_ref(ret);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3435 g_object_unref(builder);
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3436
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3437 return ret;
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3438 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3439 #endif
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3440
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
3441 static void
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3442 prefs_stack_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
3443 {
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
3444 #ifdef USE_VV
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3445 GtkStack *stack = GTK_STACK(win->stack);
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3446 GtkWidget *vv;
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
3447 #endif
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3448
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3449 bind_interface_page(win);
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
3450 bind_browser_page(win);
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3451 bind_conv_page(win);
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3452 bind_logging_page(win);
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3453 bind_network_page(win);
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3454 bind_proxy_page(win);
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3455 bind_keyring_page(win);
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3456 bind_sound_page(win);
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3457 bind_away_page(win);
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3458 bind_theme_page(win);
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
3459 #ifdef USE_VV
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3460 vv = vv_page(win);
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3461 gtk_container_add_with_properties(GTK_CONTAINER(stack), vv, "name",
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3462 "vv", "title", _("Voice/Video"),
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3463 NULL);
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
3464 g_object_unref(vv);
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
3465 #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
3466 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3467
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3468 static void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3469 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
3470 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3471 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
3472
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3473 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
3474 widget_class,
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3475 "/im/pidgin/Pidgin/Prefs/prefs.ui"
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3476 );
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3477
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3478 /* Main window */
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3479 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3480 stack);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3481 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
3482
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3483 /* Interface page */
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3484 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3485 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3486 iface.docklet.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3487 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3488 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3489 iface.im.hide_new.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3490 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3491 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3492 iface.win32.minimize_new_convs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3493 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3494 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3495 iface.conversations.tabs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3496 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3497 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3498 iface.conversations.tabs_vbox);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3499 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3500 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3501 iface.conversations.close_on_tabs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3502 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3503 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3504 iface.conversations.tab_side.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3505 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3506 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
3507 iface.conversations.placement.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
3508
39187
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3509 /* Browser page */
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3510 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3511 widget_class, PidginPrefsWindow, browser.page);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3512 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3513 widget_class, PidginPrefsWindow, browser.stack);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3514 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3515 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
3516 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3517 widget_class, PidginPrefsWindow, browser.gnome_program);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3518 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3519 widget_class, PidginPrefsWindow, browser.browser.combo);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3520 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3521 widget_class, PidginPrefsWindow, browser.place_hbox);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3522 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3523 widget_class, PidginPrefsWindow, browser.place.combo);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3524 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3525 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
3526 gtk_widget_class_bind_template_child(
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3527 widget_class, PidginPrefsWindow, browser.manual_command);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3528 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
3529 browser_button_clicked_cb);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3530 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
3531 manual_browser_set);
ff095c074d32 prefs: Convert Browsers page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39186
diff changeset
3532
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3533 /* Conversations page */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3534 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3535 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3536 conversations.notification_chat.combo);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3537 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3538 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3539 conversations.show_incoming_formatting);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3540 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3541 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3542 conversations.im.close_immediately);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3543 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3544 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3545 conversations.im.show_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3546 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3547 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3548 conversations.im.animate_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3549 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3550 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3551 conversations.im.send_typing);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3552 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3553 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3554 conversations.spellcheck);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3555 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3556 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3557 conversations.use_smooth_scrolling);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3558 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3559 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3560 conversations.win32.blink_im);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3561 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3562 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3563 conversations.resize_custom_smileys);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3564 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3565 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3566 conversations.custom_smileys_size);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3567 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3568 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3569 conversations.minimum_entry_lines);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3570 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3571 widget_class, PidginPrefsWindow,
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
3572 conversations.format_buffer);
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
3573 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
3574 widget_class, PidginPrefsWindow,
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
3575 conversations.format_view);
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3576 #ifdef WIN32
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3577 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3578 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3579 conversations.font_frame);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3580 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3581 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3582 conversations.use_theme_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3583 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3584 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3585 conversations.custom_font_hbox);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3586 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3587 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3588 conversations.custom_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3589 #endif
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3590 /* 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
3591 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
3592 apply_custom_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3593 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
3594 pidgin_custom_font_set);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
3595
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3596 /* Logging page */
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3597 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3598 widget_class, PidginPrefsWindow, logging.format.combo);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3599 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3600 widget_class, PidginPrefsWindow, logging.log_ims);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3601 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3602 widget_class, PidginPrefsWindow, logging.log_chats);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3603 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
3604 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
3605
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3606 /* Network page */
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3607 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3608 widget_class, PidginPrefsWindow, network.stun_server);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3609 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3610 widget_class, PidginPrefsWindow, network.auto_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3611 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3612 widget_class, PidginPrefsWindow, network.public_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3613 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3614 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3615 network.public_ip_hbox);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3616 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3617 widget_class, PidginPrefsWindow, network.map_ports);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3618 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3619 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3620 network.ports_range_use);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3621 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3622 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3623 network.ports_range_hbox);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3624 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3625 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3626 network.ports_range_start);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3627 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3628 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3629 network.ports_range_end);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3630 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3631 widget_class, PidginPrefsWindow, network.turn_server);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3632 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3633 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3634 network.turn_port_udp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3635 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3636 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3637 network.turn_port_tcp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3638 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3639 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3640 network.turn_username);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3641 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3642 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3643 network.turn_password);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3644 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
3645 network_stun_server_changed_cb);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3646 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
3647 auto_ip_button_clicked_cb);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3648 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
3649 network_ip_changed);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
3650 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
3651 network_turn_server_changed_cb);
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3652
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3653 /* Proxy page */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3654 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3655 widget_class, PidginPrefsWindow, proxy.stack);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3656 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3657 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
3658 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3659 widget_class, PidginPrefsWindow, proxy.gnome_program);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3660 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3661 widget_class, PidginPrefsWindow,
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3662 proxy.socks4_remotedns);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3663 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3664 widget_class, PidginPrefsWindow, proxy.type.combo);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3665 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3666 widget_class, PidginPrefsWindow, proxy.options);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3667 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3668 widget_class, PidginPrefsWindow, proxy.host);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3669 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3670 widget_class, PidginPrefsWindow, proxy.port);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3671 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3672 widget_class, PidginPrefsWindow, proxy.username);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3673 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3674 widget_class, PidginPrefsWindow, proxy.password);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3675 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
3676 proxy_button_clicked_cb);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
3677 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
3678 proxy_print_option);
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3679
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3680 /* Keyrings page */
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3681 gtk_widget_class_bind_template_child(
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3682 widget_class, PidginPrefsWindow, keyring.active.combo);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3683 gtk_widget_class_bind_template_child(
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3684 widget_class, PidginPrefsWindow, keyring.vbox);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3685
39747
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3686 /* Sounds page */
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3687 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3688 sound.method.combo);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3689 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3690 sound.method_vbox);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3691 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3692 sound.command);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3693 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3694 sound.command_hbox);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3695 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3696 sound.mute);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3697 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3698 sound.conv_focus);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3699 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3700 sound.while_status.combo);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3701 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3702 sound.event.view);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3703 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3704 sound.event.store);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3705 gtk_widget_class_bind_template_child(widget_class, PidginPrefsWindow,
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3706 sound.entry);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3707 gtk_widget_class_bind_template_callback(widget_class, sound_cmd_yeah);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3708 gtk_widget_class_bind_template_callback(widget_class, prefs_sound_sel);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3709 gtk_widget_class_bind_template_callback(widget_class, event_toggled);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3710 gtk_widget_class_bind_template_callback(widget_class, select_sound);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3711 gtk_widget_class_bind_template_callback(widget_class, test_sound);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3712 gtk_widget_class_bind_template_callback(widget_class, reset_sound);
1dffb6dad206 Convert Sound prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39711
diff changeset
3713
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3714 /* Away page */
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3715 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
3716 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3717 away.idle_reporting.combo);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3718 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
3719 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3720 away.mins_before_away);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3721 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
3722 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
3723 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
3724 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
3725 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
3726 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3727 away.auto_reply.combo);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3728 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
3729 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3730 away.startup_current_status);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3731 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
3732 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
3733 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
3734 widget_class, PidginPrefsWindow, away.startup_label);
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3735
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3736 /* Themes page */
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3737 gtk_widget_class_bind_template_child(
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3738 widget_class, PidginPrefsWindow, theme.blist);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3739 gtk_widget_class_bind_template_child(
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3740 widget_class, PidginPrefsWindow, theme.status);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3741 gtk_widget_class_bind_template_child(
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3742 widget_class, PidginPrefsWindow, theme.sound);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3743 gtk_widget_class_bind_template_child(
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3744 widget_class, PidginPrefsWindow, theme.smiley);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3745 gtk_widget_class_bind_template_callback(widget_class,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3746 prefs_set_blist_theme_cb);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3747 gtk_widget_class_bind_template_callback(widget_class,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3748 prefs_set_status_icon_theme_cb);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3749 gtk_widget_class_bind_template_callback(widget_class,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3750 prefs_set_sound_theme_cb);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3751 gtk_widget_class_bind_template_callback(widget_class,
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3752 prefs_set_smiley_theme_cb);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3753 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3754
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3755 static void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3756 pidgin_prefs_window_init(PidginPrefsWindow *win)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3757 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3758 /* 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
3759 * 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
3760 /* (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
3761
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3762 /* 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
3763
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3764 /* Create the window */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3765 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
3766
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3767 prefs_stack_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
3768
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
3769 /* 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
3770 prefs_themes_refresh();
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3771 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3772
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3773 void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3774 pidgin_prefs_show(void)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3775 {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3776 if (prefs == NULL) {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3777 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
3778 pidgin_prefs_window_get_type(), NULL));
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3779 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3780
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3781 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
3782 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3783
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3784 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
3785 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
3786 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
3787 {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3788 const gchar *theme_name = value;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3789 GList *themes, *it;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3790
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
3791 if (purple_strequal(theme_name, "none")) {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3792 purple_smiley_theme_set_current(NULL);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3793 return;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3794 }
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3795
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3796 /* XXX: could be cached when initializing prefs view */
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3797 themes = pidgin_smiley_theme_get_all();
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3798
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3799 for (it = themes; it; it = g_list_next(it)) {
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3800 PidginSmileyTheme *theme = it->data;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3801
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
3802 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
3803 continue;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3804
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3805 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
3806 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3807 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3808
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3809 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
3810 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
3811 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3812 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
3813 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
3814
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3815 #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
3816 /* 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
3817 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
3818 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
3819 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
3820 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
3821 #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
3822
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3823 /* 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
3824 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
3825 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
3826
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3827 /* 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
3828 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
3829 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
3830 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
3831 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
3832
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
3833 /* Themes */
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
3834 prefs_themes_init();
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
3835
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3836 /* 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
3837 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
3838 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
3839
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3840 /* 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
3841 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
3842 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
3843
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
3844 #ifdef USE_VV
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3845 /* Voice/Video */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3846 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
3847 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
3848 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
3849 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
3850 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
3851 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
3852 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
3853 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
3854 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
3855 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
3856 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
3857 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
3858 #endif
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3859
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3860 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
3861 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3862
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
3863 void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
3864 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
3865 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3866 /* 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
3867 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
3868 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
3869 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
3870 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
3871
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3872 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
3873
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3874 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
3875 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
3876
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
3877 /*
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
3878 * 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
3879 * 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
3880 * 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
3881 * 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
3882 */
34297
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
3883 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
3884 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
3885 PURPLE_PREF_PATH)
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
3886 {
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
3887 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
3888 PIDGIN_PREFS_ROOT "/browsers/command");
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
3889 purple_prefs_set_string(
0f1f0b8c84f8 Fix some debug log warnings, adjust verbosity level
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34287
diff changeset
3890 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
3891 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
3892 }
9e2f351bb081 Change the "Manual" browser command pref's name to allow for a relatively simple
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 30800
diff changeset
3893
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3894 /* 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
3895 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
3896 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
3897 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
3898 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
3899 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
3900 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
3901 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/tooltip_delay");
39317
b31b810fe6db gtkblist: Remove blist position storage
Mike Ruprecht <cmaiku@gmail.com>
parents: 39281
diff changeset
3902 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/x");
b31b810fe6db gtkblist: Remove blist position storage
Mike Ruprecht <cmaiku@gmail.com>
parents: 39281
diff changeset
3903 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/y");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3904 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
3905 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
3906 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
3907 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
3908 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
3909 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
3910 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
3911 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
3912 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
3913 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
3914 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
3915 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
3916 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
3917 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
3918 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
3919 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
3920 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
3921 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
3922 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
3923 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
3924 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
3925 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
3926 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
3927 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
3928 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
3929 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
3930 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
3931
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3932 /* 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
3933 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
3934 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
3935 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3936 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
3937 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3938 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
3939 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
3940 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3941 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
3942 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3943 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
3944 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
3945 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
3946
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3947 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
3948 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
3949 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
3950 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
3951 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
3952 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
3953 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
3954 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
3955
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3956 /* Fixup vvconfig plugin prefs */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3957 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
3958 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
3959 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
3960 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3961 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
3962 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
3963 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
3964 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3965 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
3966 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
3967 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
3968 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3969 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
3970 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
3971 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
3972 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3973
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3974 purple_prefs_remove("/plugins/core/vvconfig");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3975 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
3976
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3977 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
3978 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
3979 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
3980 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
3981
35105
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
3982 #ifndef _WIN32
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
3983 /* 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
3984 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
3985 /* 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
3986 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
3987 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
3988 PIDGIN_BROWSER_DEFAULT);
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
3989 }
35106
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
3990
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
3991 /* 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
3992 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
3993 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
3994 "netscape")) {
79ebfc0d91df Drop support for Netscape because it's ancient, no longer exists, is
Mark Doliner <mark@kingant.net>
parents: 35105
diff changeset
3995 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
3996 }
35105
ed127ccd9b9f Remove the "existing window" option for where to open URLs.
Mark Doliner <mark@kingant.net>
parents: 34955
diff changeset
3997 #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
3998 }
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3999

mercurial