pidgin/gtkprefs.c

Wed, 09 Oct 2019 00:42:02 -0400

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Wed, 09 Oct 2019 00:42:02 -0400
changeset 39987
9aea69045c1f
parent 39955
0ab521bb0887
child 39993
0d18609d0d01
permissions
-rw-r--r--

Replace purple_ip*_address_is_valid by GLib functions.

* Replace purple_ip_address_is_valid by g_hostname_is_ip_address.
* Remove unused purple_ipv4_address_is_valid.
* Replace purple_ipv6_address_is_valid with GInetAddress parsing.

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

mercurial