pidgin/gtkprefs.c

Tue, 06 Oct 2020 20:44:33 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 06 Oct 2020 20:44:33 -0500
changeset 40542
8079731c8ef9
parent 40509
6748a5ec6644
child 40547
86e0c5080a58
permissions
-rw-r--r--

Remove the spell checking preference as it's a talkatu feature and most are unlikely to disable it

Testing Done:
Compiled, verified the preference window still works, and sent some messages via bonjour.

Reviewed at https://reviews.imfreedom.org/r/143/

22419
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 */
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
22
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
23 #ifdef HAVE_CONFIG_H
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
24 # include <config.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
25 #endif
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
26
40462
24ed25d87550 Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
27 #include <errno.h>
24ed25d87550 Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
28 #include <math.h>
24ed25d87550 Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
29
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
30 #include <glib/gi18n-lib.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
31 #include <glib/gstdio.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
32
39264
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
33 #include <talkatu.h>
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
34
40350
72271baf92bc Split PurpleKeyValuePair out to it's own file and try to do some cleanup in the files that need to include it.
Gary Kramlich <grim@reaperworld.com>
parents: 40333
diff changeset
35 #include <purple.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
36
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 "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
38 #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
39 #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
40 #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
41 #include "gtksavedstatuses.h"
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
42 #include "gtksmiley-theme.h"
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
43 #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
44 #include "gtkutils.h"
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40490
diff changeset
45 #include "pidgincore.h"
39152
37144ff35a91 Rename gtkdebug -> pidgindebug.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38578
diff changeset
46 #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
47 #include "pidginstock.h"
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
48 #ifdef USE_VV
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
49 #include <gst/video/videooverlay.h>
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
50 #ifdef GDK_WINDOWING_WIN32
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
51 #include <gdk/gdkwin32.h>
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
52 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
53 #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
54 #include <gdk/gdkx.h>
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
55 #endif
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
56 #ifdef GDK_WINDOWING_QUARTZ
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
57 #include <gdk/gdkquartz.h>
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
58 #endif
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
59 #endif
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
60 #include <libsoup/soup.h>
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
61
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
62 #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
63
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
64 /* 25MB */
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
65 #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
66
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
67 struct theme_info {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
68 gchar *type;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
69 gchar *extension;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
70 gchar *original_name;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
71 };
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
72
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
73 typedef struct _PidginPrefCombo PidginPrefCombo;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
74
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
75 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
76 PidginPrefCombo *combo);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
77
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
78 struct _PidginPrefCombo {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
79 GtkWidget *combo;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
80 PurplePrefType type;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
81 const gchar *key;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
82 union {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
83 const char *string;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
84 int integer;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
85 gboolean boolean;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
86 } value;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
87 gint previously_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
88 gint current_active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
89 PidginPrefsBindDropdownCallback cb;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
90 };
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
91
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
92 struct _PidginPrefsWindow {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
93 GtkDialog parent;
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
94
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
95 /* Stack */
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
96 GtkWidget *stack;
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
97
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
98 /* Interface page */
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
99 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
100 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
101 PidginPrefCombo hide_new;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
102 } im;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
103 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
104 GtkWidget *minimize_new_convs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
105 } win32;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
106 struct {
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
107 GtkWidget *tabs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
108 GtkWidget *tabs_vbox;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
109 GtkWidget *close_on_tabs;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
110 PidginPrefCombo tab_side;
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
111 } conversations;
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
112 } iface;
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
113
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
114 /* Conversations page */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
115 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
116 PidginPrefCombo notification_chat;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
117 GtkWidget *show_incoming_formatting;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
118 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
119 GtkWidget *close_immediately;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
120 GtkWidget *show_buddy_icons;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
121 GtkWidget *animate_buddy_icons;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
122 GtkWidget *send_typing;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
123 } im;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
124 GtkWidget *use_smooth_scrolling;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
125 struct {
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
126 GtkWidget *blink_im;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
127 } win32;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
128 GtkWidget *resize_custom_smileys;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
129 GtkWidget *custom_smileys_size;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
130 GtkWidget *minimum_entry_lines;
39264
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
131 GtkTextBuffer *format_buffer;
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
132 GtkWidget *format_view;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
133 /* Win32 specific frame */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
134 GtkWidget *font_frame;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
135 GtkWidget *use_theme_font;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
136 GtkWidget *custom_font_hbox;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
137 GtkWidget *custom_font;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
138 } conversations;
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
139
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
140 /* Logging page */
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
141 struct {
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
142 PidginPrefCombo format;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
143 GtkWidget *log_ims;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
144 GtkWidget *log_chats;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
145 GtkWidget *log_system;
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
146 } logging;
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
147
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
148 /* Network page */
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
149 struct {
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
150 GtkWidget *stun_server;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
151 GtkWidget *auto_ip;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
152 GtkWidget *public_ip;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
153 GtkWidget *public_ip_hbox;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
154 GtkWidget *map_ports;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
155 GtkWidget *ports_range_use;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
156 GtkWidget *ports_range_hbox;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
157 GtkWidget *ports_range_start;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
158 GtkWidget *ports_range_end;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
159 GtkWidget *turn_server;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
160 GtkWidget *turn_port_udp;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
161 GtkWidget *turn_port_tcp;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
162 GtkWidget *turn_username;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
163 GtkWidget *turn_password;
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
164 } network;
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
165
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
166 /* Proxy page */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
167 struct {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
168 GtkWidget *stack;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
169 /* GNOME version */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
170 GtkWidget *gnome_not_found;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
171 GtkWidget *gnome_program;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
172 gchar *gnome_program_path;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
173 /* Non-GNOME version */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
174 GtkWidget *socks4_remotedns;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
175 PidginPrefCombo type;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
176 GtkWidget *options;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
177 GtkWidget *host;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
178 GtkWidget *port;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
179 GtkWidget *username;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
180 GtkWidget *password;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
181 } proxy;
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
182
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
183 /* Keyrings page */
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
184 struct {
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
185 PidginPrefCombo active;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
186 GtkWidget *vbox;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
187 PurpleRequestFields *settings;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
188 GtkWidget *settings_box;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
189 GtkWidget *apply;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
190 } keyring;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
191
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
192 /* Away page */
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
193 struct {
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
194 PidginPrefCombo idle_reporting;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
195 GtkWidget *mins_before_away;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
196 GtkWidget *idle_hbox;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
197 GtkWidget *away_when_idle;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
198 PidginPrefCombo auto_reply;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
199 GtkWidget *startup_current_status;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
200 GtkWidget *startup_hbox;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
201 GtkWidget *startup_label;
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
202 } away;
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
203
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
204 /* Themes page */
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
205 struct {
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
206 SoupSession *session;
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
207 GtkWidget *blist;
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
208 GtkWidget *status;
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
209 GtkWidget *smiley;
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
210 } theme;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
211
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
212 #ifdef USE_VV
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
213 /* Voice/Video page */
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
214 struct {
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
215 struct {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
216 PidginPrefCombo input;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
217 PidginPrefCombo output;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
218 GtkWidget *level;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
219 GtkWidget *threshold;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
220 GtkWidget *volume;
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
221 GtkWidget *test;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
222 GstElement *pipeline;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
223 } voice;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
224
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
225 struct {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
226 PidginPrefCombo input;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
227 PidginPrefCombo output;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
228 GtkWidget *drawing_area;
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
229 GtkWidget *test;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
230 GstElement *pipeline;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
231 } video;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
232 } vv;
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
233 #endif
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
234 };
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
235
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
236 /* Main dialog */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
237 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
238
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
239 /* Themes page */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
240 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
241 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
242 static GtkWidget *prefs_smiley_themes_combo_box;
23645
6901039a86fb Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23261
diff changeset
243
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
244 /* 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
245 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
246 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
247 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
248
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
249 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
250 * 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
251 */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
252 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
253 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
254
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
255 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
256 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
257 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
258 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
259 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
260
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
261 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
262
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
263 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
264 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
265
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
266 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
267 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
268 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
269 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
270 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
271 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
272 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
273
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
274 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
275
33172
9fb9057fc55c Fix warnings about GtkAdjustments on GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33170
diff changeset
276 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
277 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
278 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
279 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
280 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
281 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
282 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
283 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
284 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
285 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
286
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
287 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
288 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
289
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
290 static void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
291 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
292 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
293 GtkAdjustment *adjust;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
294 int val;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
295
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
296 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
297
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
298 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
299 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
300 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
301 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
302 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
303 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
304
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
305 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
306 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
307 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
308 const char *key = (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
309
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
310 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
311 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
312
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
313 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
314 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
315 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
316 {
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 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
318 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
319
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
320 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
321
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
322 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
323 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
324 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
325 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
326 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
327
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 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
329 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
330
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
331 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
332 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
333 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
334 const gchar *value;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
335
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
336 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
337
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
338 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
339 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
340 (char*)key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
341 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
342
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
343 GtkWidget *
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
344 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
345 const char *key, GtkSizeGroup *sg)
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
346 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
347 GtkWidget *entry;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
348 const gchar *value;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
349
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
350 value = purple_prefs_get_string(key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
351
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
352 entry = gtk_entry_new();
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
353 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
354 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
355 g_signal_connect(G_OBJECT(entry), "changed",
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
356 G_CALLBACK(entry_set), (char*)key);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
357 gtk_widget_show(entry);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
358
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
359 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
360 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
361
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
362 /* 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
363 enum {
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
364 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
365 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
366 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
367 };
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
368
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
369 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
370 {
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 PurplePrefType type;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
372 union {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
373 const char *string;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
374 int integer;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
375 gboolean boolean;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
376 } value;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
377 } PidginPrefValue;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
378
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
379 typedef void (*PidginPrefsDropdownCallback)(GtkComboBox *combo_box,
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
380 PidginPrefValue value);
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
381
22419
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 static void
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
383 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
384 {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
385 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
386 GtkTreeIter iter;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
387 GtkTreeModel *tree_model;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
388 PidginPrefValue active;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
389
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
390 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
391 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
392 return;
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
393 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
394 "type"));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
395
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
396 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
397 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
398 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
399 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
400
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
401 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
402 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
403 &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
404 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
405 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
406 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
407 &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
408 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
409 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
410 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
411 &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
412 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
413
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
414 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
415 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
416
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
417 static void
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
418 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
419 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
420 g_return_if_fail(combo != NULL);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
421
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
422 combo->current_active = combo->previously_active;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
423
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
424 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
425 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
426 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
427
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
428 static GtkWidget *
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
429 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
430 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
431 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
432 {
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
433 GtkWidget *dropdown;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
434 GtkWidget *label = NULL;
32904
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
435 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
436 GtkTreeIter iter;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
437 GtkTreeIter active;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
438 GtkCellRenderer *renderer;
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
439 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
440
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
441 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
442
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
443 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
444 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
445 } 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
446 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
447 } 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
448 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
449 } else {
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
450 g_warn_if_reached();
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
451 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
452 }
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
453
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
454 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
455 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
456 *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
457 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
458
40326
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
459 for (; menuitems != NULL; menuitems = g_list_next(menuitems)) {
40329
b5e0f65a5d9c Replace PurpleNamedValue with PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents: 40326
diff changeset
460 const PurpleKeyValuePair *menu_item = menuitems->data;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
461 int int_value = 0;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
462 const char *str_value = NULL;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
463 gboolean bool_value = FALSE;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
464
40329
b5e0f65a5d9c Replace PurpleNamedValue with PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents: 40326
diff changeset
465 if (menu_item->key == NULL) {
40326
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
466 break;
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
467 }
22419
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
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
469 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
470 gtk_list_store_set(store, &iter,
40329
b5e0f65a5d9c Replace PurpleNamedValue with PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents: 40326
diff changeset
471 PREF_DROPDOWN_TEXT, menu_item->key,
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
472 -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
473
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
474 if (initial.type == PURPLE_PREF_INT) {
40326
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
475 int_value = GPOINTER_TO_INT(menu_item->value);
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
476 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
477 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
478 -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
479 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
480 else if (initial.type == PURPLE_PREF_STRING) {
40326
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
481 str_value = (const char *)menu_item->value;
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
482 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
483 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
484 -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
485 }
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
486 else if (initial.type == PURPLE_PREF_BOOLEAN) {
40326
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
487 bool_value = (gboolean)GPOINTER_TO_INT(menu_item->value);
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
488 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
489 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
490 -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
491 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
492
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
493 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
494 initial.value.integer == int_value) ||
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
495 (initial.type == PURPLE_PREF_STRING &&
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
496 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
497 (initial.type == PURPLE_PREF_BOOLEAN &&
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
498 (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
499
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
500 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
501 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
502 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
503
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
504 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
505 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
506 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
507 "text", 0,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
508 NULL);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
509
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
510 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
511 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
512 dropdown)));
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
513 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
514 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
515
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
516 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
517 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
518
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 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
520
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
521 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
522 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
523
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
524 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
525 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
526 PidginPrefValue value)
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
527 {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
528 const char *key;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
529
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
530 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
531
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
532 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
533 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
534 } 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
535 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
536 } 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
537 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
538 } else {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
539 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
540 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
541 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
542
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 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
544 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
545 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
546 {
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
547 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
548 GtkComboBox *dropdown = NULL;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
549 GtkWidget *label;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
550
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
551 initial.type = type;
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
552 if (type == PURPLE_PREF_INT) {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
553 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
554 } 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
555 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
556 } 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
557 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
558 } else {
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
559 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
560 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
561
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
562 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
563 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
564
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
565 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
566
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
567 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
568 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
569
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
570 GtkWidget *
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
571 pidgin_prefs_dropdown(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
572 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
573 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
574 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
575 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
576 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
577 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
578 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
579 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
580
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
581 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
582 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
583
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
584 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
585 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
586
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
587 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
588
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
589 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
590 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
591 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
592 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
593 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
594 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
595 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
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 }
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 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
599
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 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
601
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
602 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
603
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
604 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
605 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
606
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
607 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
608
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
609 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
610 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
611
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
612 static void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
613 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
614 PidginPrefCombo *combo)
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
615 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
616 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
617 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
618 } 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
619 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
620 } 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
621 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
622 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
623 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
624 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
625 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
626
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
627 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
628 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
629 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
630 PidginPrefCombo *combo = data;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
631 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
632 GtkTreeModel *tree_model;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
633
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
634 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
635 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
636 return;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
637
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
638 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
639 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
640
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
641 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
642 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
643 &combo->value.integer, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
644 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
645 else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
646 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
647 &combo->value.string, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
648 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
649 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
650 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
651 &combo->value.boolean, -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
652 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
653
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
654 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
655 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
656
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
657 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
658 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
659 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
660 gchar *text;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
661 GtkListStore *store = NULL;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
662 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
663 GtkTreeIter active;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
664
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
665 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
666
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
667 if (combo->type == PURPLE_PREF_INT) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
668 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
669 } else if (combo->type == PURPLE_PREF_STRING) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
670 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
671 } else if (combo->type == PURPLE_PREF_BOOLEAN) {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
672 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
673 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
674 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
675 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
676
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
677 store = GTK_LIST_STORE(
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
678 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
679
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
680 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
681 int int_value = 0;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
682 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
683 gboolean bool_value = FALSE;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
684
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
685 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
686 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
687
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
688 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
689 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
690 PREF_DROPDOWN_TEXT, text,
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
691 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
692
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
693 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
694 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
695 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
696 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
697 -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 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
701 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
702 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
703 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
704 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
705 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
706 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
707 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
708 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
709 -1);
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
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
712 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
713 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
714 (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
715 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
716 (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
717 (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
718
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
719 active = iter;
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
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
722 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
723 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
724
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
725 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
726 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
727 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
728 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
729
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
730 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
731 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
732 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
733 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
734
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
735 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
736 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
737 {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
738 GtkTreeModel *store = NULL;
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
739 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
740 GtkTreeIter active;
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 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
743 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
744 } 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
745 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
746 } 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
747 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
748 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
749 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
750 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
751
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
752 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
753
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
754 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
755 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
756 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
757
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
758 do {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
759 int int_value = 0;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
760 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
761 gboolean bool_value = FALSE;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
762
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
763 if (combo->type == PURPLE_PREF_INT) {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
764 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
765 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
766 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
767 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
768 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
769 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
770 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
771 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
772 else if (combo->type == PURPLE_PREF_STRING) {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
773 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
774 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
775 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
776 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
777 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
778 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
779 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
780 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
781 else if (combo->type == PURPLE_PREF_BOOLEAN) {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
782 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
783 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
784 -1);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
785 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
786 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
787 break;
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 }
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
790 } 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
791
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
792 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
793
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
794 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
795 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
796 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
797
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
798 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
799 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
800 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
801 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
802
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
803 static void
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
804 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
805 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
806 purple_prefs_set_bool(key,
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
807 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
808 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
809
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
810 GtkWidget *
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
811 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
812 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
813 GtkWidget *button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
814
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
815 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
816 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
817 purple_prefs_get_bool(key));
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
818
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
819 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
820
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
821 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
822 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
823
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
824 gtk_widget_show(button);
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
825
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
826 return button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
827 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
828
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
829 static void
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
830 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
831 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
832 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
833 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
834 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
835 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
836 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
837
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
838 static void keyring_page_cleanup(PidginPrefsWindow *win);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
839
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
840 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
841 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
842 {
40509
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
843 /* Close any request dialogs */
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
844 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
845
34188
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
846 purple_notify_close_with_handle(prefs);
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
847
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
848 g_clear_object(&prefs->theme.session);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
849
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
850 /* 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
851 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
852
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
853 /* 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
854 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
855 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
856 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
857
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
858 keyring_page_cleanup(prefs);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
859
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
860 g_free(prefs->proxy.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
861 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
862 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
863
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
864 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
865 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
866 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
867 {
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
868
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
869 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
870 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
871 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
872 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
873 }
3e1e60af8256 Mark theme prefs as translatable, refactor slightly for consistency and plug a small leak.
Daniel Atallah <datallah@pidgin.im>
parents: 28514
diff changeset
874
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
875 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
876 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
877 {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
878 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
879 GtkTreeIter iter;
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
880 gchar *description;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
881
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
882 description = get_theme_markup(_("none"), FALSE, _("Penguin Pimps"),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
883 _("Selecting this disables graphical emoticons."));
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
884 gtk_list_store_append(prefs_smiley_themes, &iter);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
885 gtk_list_store_set(prefs_smiley_themes, &iter,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
886 0, NULL, 1, description, 2, "none", -1);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
887 g_free(description);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
888
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
889 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
890 PidginSmileyTheme *theme = it->data;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
891
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
892 description = get_theme_markup(
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
893 _(pidgin_smiley_theme_get_name(theme)), FALSE,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
894 _(pidgin_smiley_theme_get_author(theme)),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
895 _(pidgin_smiley_theme_get_description(theme)));
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
896
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
897 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
898 gtk_list_store_set(prefs_smiley_themes, &iter,
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
899 0, pidgin_smiley_theme_get_icon(theme),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
900 1, description,
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
901 2, pidgin_smiley_theme_get_name(theme),
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
902 -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
903
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 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
905 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
906 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
907
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
908 /* 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
909 static void
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
910 prefs_themes_sort(PurpleTheme *theme)
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
911 {
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
912 GdkPixbuf *pixbuf = NULL;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
913 GtkTreeIter iter;
23668
a3f9f6c42dff Fixed some small rendering errors in conversations and prefs
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23664
diff changeset
914 gchar *image_full = NULL, *markup;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
915 const gchar *name, *author, *description;
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
916
40509
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
917 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
918 GtkListStore *store;
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
919
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
920 if (PIDGIN_IS_BLIST_THEME(theme))
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
921 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
922 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
923 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
924
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
925 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
926 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
927 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
928 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
929 } 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
930 pixbuf = NULL;
23664
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
931
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
932 name = purple_theme_get_name(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
933 author = purple_theme_get_author(theme);
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
934 description = purple_theme_get_description(theme);
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
935
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
936 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
937
23967
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
938 gtk_list_store_append(store, &iter);
cc5667bc8f1e Clean up status icon themes a bit
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23964
diff changeset
939 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
940
cf938922baa5 Changed how the prefs handle themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23661
diff changeset
941 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
942 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
943 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
944
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
945 }
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
946 }
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
947
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
948 static void
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
949 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
950 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
951 GtkTreeIter iter;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
952 gchar *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
953 gboolean unset = TRUE;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
954
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
955 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
956 do {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
957 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
958
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
959 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
960 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
961 unset = FALSE;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
962 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
963
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
964 g_free(theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
965 } 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
966 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
967
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
968 if (unset)
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
969 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
970 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
971
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
972 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
973 prefs_themes_refresh(void)
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
974 {
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
975 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
976 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
977 GtkTreeIter iter;
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
978
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
979 /* 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
980 purple_theme_manager_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
981
35850
1abeda205d6c cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35748
diff changeset
982 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
983 "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
984 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
985 g_free(tmp);
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
986
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
987 /* blist themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
988 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
989 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
990 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
991 _("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
992 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
993 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
994
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
995 /* status icon themes */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
996 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
997 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
998 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
999 _("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
1000 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
1001 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
1002 if (pixbuf)
48c271584931 Prevent an assertion when the status icon pixbuf isn't found.
Daniel Atallah <datallah@pidgin.im>
parents: 28627
diff changeset
1003 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
1004
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
1005 /* 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
1006 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
1007
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1008 purple_theme_manager_for_each_theme(prefs_themes_sort);
28901
e0098fe083e4 Rename a smiley theme function to be a bit more descriptive.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28900
diff changeset
1009 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
1010
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1011 /* set active */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1012 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
1013 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
1014 prefs_set_active_theme_combo(prefs_smiley_themes_combo_box, prefs_smiley_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme"));
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1015 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1016
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1017 /* 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
1018 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1019 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
1020 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1021 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
1022
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1023 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
1024
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
1025 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
1026 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1027
35455
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1028 /*
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1029 * prefs_theme_find_theme:
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1030 * @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
1031 * 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
1032 * @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
1033 * 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
1034 * "theme."
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1035 *
33562
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1036 * 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
1037 * 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
1038 * load each subdirectory that we encounter.
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1039 *
35455
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35454
diff changeset
1040 * Returns: A new reference to a #PurpleTheme.
33562
d35beaf69a32 Documentationliness is next to beardliness.
Mark Doliner <mark@kingant.net>
parents: 33534
diff changeset
1041 */
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1042 static PurpleTheme *
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1043 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
1044 {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1045 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
1046 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
1047 const gchar *next;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1048
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1049 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
1050 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
1051
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1052 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
1053 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
1054
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1055 g_free(next_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1056 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1057
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1058 g_dir_close(dir);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1059
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1060 return theme;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1061 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1062
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
1063 /* 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
1064 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
1065 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
1066 {
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1067 FILE *src, *dest;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1068 gint chr = EOF;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1069
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1070 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
1071 return FALSE;
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1072 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
1073 fclose(src);
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1074 return FALSE;
27451
6dcd55e2c594 Handle dest failing to open properly by closing the src handle.
Paul Aurich <darkrain42@pidgin.im>
parents: 27450
diff changeset
1075 }
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
1076
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1077 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
1078 fputc(chr, dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1079 }
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1080
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1081 fclose(dest);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1082 fclose(src);
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1083
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1084 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
1085 }
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1086
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1087 static void
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1088 free_theme_info(struct theme_info *info)
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1089 {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1090 if (info != NULL) {
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1091 g_free(info->type);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1092 g_free(info->extension);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1093 g_free(info->original_name);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1094 g_free(info);
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1095 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1096 }
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1097
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1098 /* 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
1099 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1100 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
1101 {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1102 gchar *destdir;
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1103 const char *tail;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1104 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
1105 PurpleTheme *theme = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1106
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1107 if (info == NULL)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1108 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1109
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1110 /* check the extension */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1111 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
1112
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1113 if (!tail) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1114 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
1115 return;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1116 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1117
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1118 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
1119
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1120 /* Just to be safe */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1121 g_strchomp(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1122
38256
035f00c4fd87 Replace misused g_str_equal() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 36029
diff changeset
1123 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
1124 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
1125 else
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1126 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
1127
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1128 /* 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
1129 * 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
1130 if (is_archive) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1131 #ifndef _WIN32
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1132 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
1133 gchar *destdir_escaped = g_shell_quote(destdir);
39918
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39856
diff changeset
1134 gchar *command;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1135
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1136 if (!g_file_test(destdir, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1137 g_mkdir_with_parents(destdir, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1138 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1139
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1140 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
1141 g_free(path_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1142 g_free(destdir_escaped);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1143
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1144 /* Fire! */
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1145 if (system(command)) {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1146 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
1147 g_free(command);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1148 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1149 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
1150 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1151 }
39918
1c8e11f9274f Fix several memory leaks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39856
diff changeset
1152 g_free(command);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1153 #else
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1154 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
1155 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
1156 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1157 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
1158 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1159 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1160 #endif
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1161 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1162
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1163 if (is_smiley_theme) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1164 /* 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
1165 prefs_themes_refresh();
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1166
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1167 } else if (is_archive) {
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1168 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
1169
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1170 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
1171 /* 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
1172 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
1173 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
1174 "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
1175
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1176 if (!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1177 g_mkdir_with_parents(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1178 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1179
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1180 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
1181 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
1182 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
1183 "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
1184
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1185 /* 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
1186 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
1187 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
1188 "%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
1189 g_strerror(errno));
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1190 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1191
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1192 g_free(theme_dest);
36029
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1193 if (g_remove(destdir) != 0) {
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1194 purple_debug_error("gtkprefs",
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1195 "couldn't remove temp (dest) path\n");
cd7db320cf5c Fix coverity regression warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35991
diff changeset
1196 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1197 g_object_unref(theme);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1198
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1199 prefs_themes_refresh();
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1200
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1201 } else {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1202 /* 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
1203 g_unlink(destdir);
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1204 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
1205 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1206
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1207 } 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
1208 gchar *temp_path, *temp_file;
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1209
39955
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1210 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
1211 "sub_folder", NULL);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1212
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1213 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
1214 /* 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
1215 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
1216
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1217 } 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
1218 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
1219 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
1220 g_free(source_name);
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
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
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1223 if (!g_file_test(temp_path, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1224 g_mkdir_with_parents(temp_path, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1225 }
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
1226
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1227 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
1228 /* find the theme, could be in subfolder */
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1229 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
1230
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1231 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
1232 gchar *theme_dest =
0ab521bb0887 Move smileys and themes to XDG data directory.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39918
diff changeset
1233 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
1234 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
1235 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
1236
40124
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1237 if(!g_file_test(theme_dest, G_FILE_TEST_IS_DIR)) {
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1238 g_mkdir_with_parents(theme_dest, S_IRUSR | S_IWUSR | S_IXUSR);
cdce45867b10 Replace purple_build_dir with g_mkdir_with_parents.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40058
diff changeset
1239 }
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
1240
33563
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1241 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
1242 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
1243 "%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
1244 g_strerror(errno));
981ea717afd2 Log an error if g_rename fails when installing a theme.
Mark Doliner <mark@kingant.net>
parents: 33562
diff changeset
1245 }
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
1246
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1247 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
1248 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
1249
acf9ce9edb4a Update this to not use GIO, so it should build for poizon. Refs #8085.
Paul Aurich <darkrain42@pidgin.im>
parents: 27449
diff changeset
1250 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
1251 } else {
35991
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1252 if (g_remove(temp_path) != 0) {
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1253 purple_debug_error("gtkprefs",
36002
31a8779e91d4 Merge release-2.x.y
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35989 35991
diff changeset
1254 "couldn't remove temp path");
35991
e6937e52930b Fix some CWE-252 coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35986
diff changeset
1255 }
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1256 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
1257 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1258 } else {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1259 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
1260 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1261
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1262 g_free(temp_file);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1263 g_free(temp_path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1264 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1265
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1266 g_free(destdir);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1267 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
1268 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1269
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1270 static void
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1271 theme_got_url(G_GNUC_UNUSED SoupSession *session, SoupMessage *msg,
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1272 gpointer _info)
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1273 {
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1274 struct theme_info *info = _info;
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1275 FILE *f;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1276 gchar *path;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1277 size_t wc;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1278
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1279 if (!SOUP_STATUS_IS_SUCCESSFUL(msg->status_code)) {
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
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;
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1282 }
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1283
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1284 f = purple_mkstemp(&path, TRUE);
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1285 wc = fwrite(msg->response_body->data, msg->response_body->length, 1, f);
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1286 if (wc != 1) {
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1287 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
1288 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1289 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1290 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
1291 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
1292 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1293 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1294 fclose(f);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1295
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
1296 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
1297
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1298 g_unlink(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1299 g_free(path);
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1300 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1301
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1302 static void
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1303 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
1304 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
1305 {
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
1306 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
1307
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
1308 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
1309 && (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
1310 /* 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
1311 * 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
1312 gchar *temp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1313 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
1314 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
1315 info->extension = g_strdup(g_strrstr(name,"."));
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1316 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
1317 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
1318
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1319 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
1320 GError *converr = NULL;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1321 gchar *tmp;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1322 /* 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
1323 * 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
1324 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
1325 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
1326 (converr ? converr->message :
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1327 "g_filename_from_uri error"));
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1328 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
1329 return;
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1330 }
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1331 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
1332 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
1333 } 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
1334 !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
1335 /* 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
1336 * will start to get interesting */
39993
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1337 SoupMessage *msg;
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1338
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1339 if (prefs->theme.session == NULL) {
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1340 prefs->theme.session = soup_session_new();
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1341 }
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1342
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1343 soup_session_abort(prefs->theme.session);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1344
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1345 msg = soup_message_new("GET", name);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1346 // purple_http_request_set_max_len(msg, PREFS_MAX_DOWNLOADED_THEME_SIZE);
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1347 soup_session_queue_message(prefs->theme.session, msg, theme_got_url,
0d18609d0d01 Convert Pidgin to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39987
diff changeset
1348 info);
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1349 } else
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1350 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
1351
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1352 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
1353 }
27449
ebd2e0ae2e3a Kill whitespace at the end of lines.
Paul Aurich <darkrain42@pidgin.im>
parents: 27445
diff changeset
1354
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1355 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
1356 }
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
1357
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1358 /* 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
1359 static void
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1360 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
1361 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
1362 {
28483
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1363 GtkTargetEntry te[3] = {
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1364 {"text/plain", 0, 0},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1365 {"text/uri-list", 0, 1},
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1366 {"STRING", 0, 2}
cb2bf1551a0e Wordwrap just a little bit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28482
diff changeset
1367 };
23964
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1368
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1369 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
1370
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1371 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
1372 GTK_TREE_MODEL(store));
25887
6eac2f6c32e2 s/sucess/success/ in a few places
Mark Doliner <markdoliner@pidgin.im>
parents: 25874
diff changeset
1373
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1374 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
1375 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
1376
28552
820f226bceb0 Plug some leaks.
Daniel Atallah <datallah@pidgin.im>
parents: 28551
diff changeset
1377 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
1378 }
342e3f5bedd9 partially working status icon theme stuff
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23668
diff changeset
1379
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
1380 /* 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
1381 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
1382 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
1383 {
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
1384 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
1385 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
1386
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
1387 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
1388
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
1389 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
1390
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
1391 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
1392
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
1393 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
1394 }
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
1395 }
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
1396
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
1397
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1398 /* 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
1399 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
1400 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
1401 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
1402 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
1403 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1404 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
1405 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
1406
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
1407 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
1408 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
1409
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1410 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
1411 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
1412 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
1413 } 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
1414 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
1415 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
1416 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
1417 /* 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
1418 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
1419 } 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
1420 /* 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
1421 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
1422 } 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
1423 /* 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
1424 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
1425 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1426
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1427 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
1428 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
1429
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1430 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
1431 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1432
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
1433 /* 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
1434 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
1435 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
1436 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1437 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
1438 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
1439 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
1440
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1441 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
1442
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1443 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
1444
38265
ee28d52fe2ca Use conventional style for empty string check
qarkai <qarkai@gmail.com>
parents: 38262
diff changeset
1445 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
1446 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
1447
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1448 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
1449
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1450 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
1451 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1452 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1453
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1454 /* 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
1455 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
1456 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
1457 {
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1458 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
1459 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
1460 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
1461
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1462 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
1463
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1464 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
1465
38265
ee28d52fe2ca Use conventional style for empty string check
qarkai <qarkai@gmail.com>
parents: 38262
diff changeset
1466 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
1467 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
1468
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1469 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
1470
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1471 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
1472 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
1473 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1474 }
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1475
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1476 static void
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1477 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
1478 {
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
1479 /* Buddy List Themes */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1480 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
1481 PIDGIN_PREFS_ROOT "/blist/theme", "blist");
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1482 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
1483
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1484 /* Status Icon Themes */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1485 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
1486 PIDGIN_PREFS_ROOT "/status/icon-theme",
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1487 "icon");
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1488 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
1489
26cb345c8757 Move the status icon and blist theme comboboxes to the Themes tab. This looks
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28851
diff changeset
1490 /* Smiley Themes */
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1491 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
1492 PIDGIN_PREFS_ROOT "/smileys/theme",
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1493 "smiley");
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
1494 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
1495
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1496 /* 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
1497 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
1498 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
1499 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
1500 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
1501 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1502
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1503 static void
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1504 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
1505 {
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1506 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
1507 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
1508 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
1509 activated);
39267
0e4718ab2f9b remove a stray tab
Gary Kramlich <grim@reaperworld.com>
parents: 39266
diff changeset
1510 } 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
1511 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
1512 activated);
39268
82cdabe4bd2f remove more stray tabs
Gary Kramlich <grim@reaperworld.com>
parents: 39267
diff changeset
1513 } 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
1514 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
1515 activated);
39268
82cdabe4bd2f remove more stray tabs
Gary Kramlich <grim@reaperworld.com>
parents: 39267
diff changeset
1516 } 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
1517 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
1518 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
1519 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1520 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1521
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1522 static void
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1523 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
1524 {
25888
d0fdd378a635 Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 25887
diff changeset
1525 /* System Tray */
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1526 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
1527 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
1528 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
1529
27592
c252cad34998 Rename the "Conversation Window Hiding" preferences section to "Conversation
Etan Reisner <deryni@pidgin.im>
parents: 27196
diff changeset
1530 #ifdef _WIN32
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1531 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
1532 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
1533 #else
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1534 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
1535 #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
1536
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1537 /* All the tab options! */
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1538 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
1539 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
1540
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1541 /*
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1542 * 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
1543 * 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
1544 */
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1545 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
1546 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
1547 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
1548
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1549 pidgin_prefs_bind_checkbox(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
1550 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
1551 win->iface.conversations.close_on_tabs);
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1552
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
1553 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
1554 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
1555 pidgin_prefs_bind_dropdown(&win->iface.conversations.tab_side);
22419
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 }
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
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1558 /* 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
1559 static void
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1560 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
1561 {
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
1562 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
1563 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
1564 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
1565 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
1566 }
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
1567
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1568 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
1569 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
1570 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
1571
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
1572 }
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1573
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
1574 static void
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1575 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
1576 {
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
1577
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1578 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
1579 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
1580
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1581 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
1582 }
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1583
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1584 static void
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1585 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
1586 {
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1587 GSimpleActionGroup *ag = NULL;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1588
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1589 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
1590 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
1591 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
1592
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1593 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
1594 win->conversations.show_incoming_formatting);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1595 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
1596 win->conversations.im.close_immediately);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1597
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1598 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
1599 win->conversations.im.show_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1600 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
1601 win->conversations.im.animate_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1602 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
1603 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
1604 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
1605
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1606 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
1607 win->conversations.im.send_typing);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1608
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1609 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
1610 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
1611
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1612 #ifdef _WIN32
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1613 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
1614 win->conversations.win32.blink_im);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1615 #else
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1616 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
1617 #endif
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1618
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1619 #if 0
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1620 /* TODO: it's not implemented */
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1621 pidgin_prefs_bind_checkbox(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1622 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
1623 win->conversations.resize_custom_smileys);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1624
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1625 pidgin_prefs_bind_spin_button(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1626 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
1627 win->conversations.custom_smileys_size);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1628
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1629 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
1630 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
1631 G_BINDING_SYNC_CREATE);
35748
6c4993b737a4 Smileys: get rid of old implementation
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35733
diff changeset
1632 #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
1633
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1634 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
1635 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
1636 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
1637
29656
2dfea274d539 Fix the Windows font pref for the new GTK version requirements.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 29655
diff changeset
1638 #ifdef _WIN32
28919
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1639 {
efd38b9bc1b1 Fix some stuff in the prefs dialog on Win32
Daniel Atallah <datallah@pidgin.im>
parents: 28916
diff changeset
1640 const char *font_name;
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1641 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
1642
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1643 pidgin_prefs_bind_checkbox(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1644 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
1645 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
1646
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
1647 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
1648 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
1649 gtk_font_chooser_set_font(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1650 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
1651 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
1652 }
d8538334b167 I *think* this properly adds back the font preference stuff I axed earlier, but
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28907
diff changeset
1653
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
1654 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
1655 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
1656 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
1657 }
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
1658 #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
1659
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
1660 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
1661 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
1662 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
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
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1665 static void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1666 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
1667 {
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
1668 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
1669 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
1670
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
1671 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
1672 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
1673 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
1674 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
1675 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
1676 } else {
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1677 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
1678 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
1679 }
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
1680
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
1681 } 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
1682 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
1683 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
1684 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
1685 }
22419
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
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1688 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1689 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
1690 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
1691 {
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
1692 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
1693 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
1694 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
1695 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
1696
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
1697 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
1698 }
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
1699
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1700 static gboolean
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1701 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
1702 GdkEventFocus *event, gpointer data)
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1703 {
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1704 GtkEntry *entry = GTK_ENTRY(widget);
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1705 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
1706 gtk_entry_get_text(entry));
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1707 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
1708
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1709 return FALSE;
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1710 }
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1711
22419
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 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
1713 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
1714 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
1715 {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1716 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
1717 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
1718
38259
c593fc9f5438 Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents: 38258
diff changeset
1719 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
1720 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
1721 else
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1722 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
1723 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1724
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
1725 static void
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1726 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
1727 {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1728 if (entry == win->proxy.host) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1729 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
1730 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
1731 } else if (entry == win->proxy.port) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1732 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
1733 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
1734 GTK_SPIN_BUTTON(entry)));
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1735 } else if (entry == win->proxy.username) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1736 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
1737 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
1738 } else if (entry == win->proxy.password) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1739 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
1740 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
1741 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1742 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1743
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1744 static void
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1745 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
1746 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1747 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
1748
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1749 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
1750 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
1751
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
1752 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
1753 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
1754 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1755
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1756 static void
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
1757 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
1758 {
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
1759 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
1760 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
1761 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
1762
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
1763 /* 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
1764 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
1765 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
1766
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
1767 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
1768 /* 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
1769 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
1770 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
1771 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
1772 } 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
1773 /* 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
1774 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
1775 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
1776 /* 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
1777 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
1778 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
1779 /* 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
1780 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
1781 }
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
1782 }
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
1783 }
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
1784 }
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
1785 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
1786 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
1787
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
1788 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
1789 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
1790 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
1791 }
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
1792
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1793 static void
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1794 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
1795 {
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1796 GtkStyleContext *context;
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1797 GtkCssProvider *ip_css;
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1798 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
1799 ".bad-ip {"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1800 "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
1801 "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
1802 "background-image: none;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1803 "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
1804 "}"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1805 ".good-ip {"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1806 "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
1807 "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
1808 "background-image: none;"
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1809 "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
1810 "}";
22419
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
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1812 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
1813 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
1814
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1815 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
1816 win->network.auto_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1817 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
1818
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1819 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
1820 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
1821
33924
788678d2e035 Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33896
diff changeset
1822 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
1823 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
1824 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
1825 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
1826 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
1827 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
1828
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1829 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
1830 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
1831 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
1832
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1833 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
1834 win->network.map_ports);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1835
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1836 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
1837 win->network.ports_range_use);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1838 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
1839 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
1840 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
1841
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1842 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
1843 win->network.ports_range_start);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1844 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
1845 win->network.ports_range_end);
26261
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1846
ffabb135a4b6 Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents: 26256
diff changeset
1847 /* TURN server */
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1848 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
1849 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
1850
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1851 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
1852 win->network.turn_port_udp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1853
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1854 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
1855 win->network.turn_port_tcp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1856
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1857 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
1858 win->network.turn_username);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
1859 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
1860 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
1861 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1862
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1863 static void
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1864 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
1865 {
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1866 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
1867
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
1868 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
1869 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
1870
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1871 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
1872 "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
1873
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
1874 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
1875 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
1876 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
1877 if (path == NULL) {
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
1878 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
1879 if (path != NULL) {
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
1880 char *tmp = g_strdup_printf("%s network", path);
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
1881 g_free(path);
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
1882 path = tmp;
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
1883 }
6917cde256ec *** Plucked rev adb5993fd26854de08af6ca2864eeb3fe1fc8c1d (qulogic@pidgin.im):
Mark Doliner <markdoliner@pidgin.im>
parents: 31941
diff changeset
1884 }
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
1885
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1886 win->proxy.gnome_program_path = path;
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1887 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
1888 path == NULL);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1889 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
1890 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
1891 } else {
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1892 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
1893 "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
1894
28891
6502040769d4 Silence some assertions QuLogic noticed.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28890
diff changeset
1895 /* 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
1896 * account-specific proxy settings */
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1897 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
1898 win->proxy.socks4_remotedns);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1899
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1900 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
1901 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
1902 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
1903 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
1904
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
1905 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
1906 proxy_changed_cb, win);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1907
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1908 if (proxy_info != NULL) {
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1909 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
1910 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
1911 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
1912 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1913
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1914 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
1915 gtk_spin_button_set_value(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1916 GTK_SPIN_BUTTON(win->proxy.port),
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1917 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
1918 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1919
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1920 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
1921 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
1922 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
1923 }
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1924
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
1925 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
1926 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
1927 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
1928 }
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
1929 }
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
1930
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
1931 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
1932 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
1933 win);
28848
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1934 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1935 }
5004d2e82e68 Move the proxy stuff to a separate tab, per deryni's suggestion.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 28847
diff changeset
1936
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
1937 static void
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
1938 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
1939 {
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 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
1941
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
1942 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
1943 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
1944 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
1945 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
1946 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
1947
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
1948 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
1949 win->logging.log_ims);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
1950 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
1951 win->logging.log_chats);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
1952 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
1953 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
1954 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
1955
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1956 /*** keyring page *******************************************************/
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1957
33998
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
1958 static void
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1959 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
1960 {
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1961 PurpleRequestField *setting = _setting;
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1962 PurpleRequestFieldType field_type;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1963
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
1964 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
1965
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
1966 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
1967
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1968 if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1969 purple_request_field_bool_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1970 gtk_toggle_button_get_active(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1971 GTK_TOGGLE_BUTTON(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1972 } else if (field_type == PURPLE_REQUEST_FIELD_STRING) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1973 purple_request_field_string_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1974 gtk_entry_get_text(GTK_ENTRY(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1975 } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1976 purple_request_field_int_set_value(setting,
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1977 gtk_spin_button_get_value_as_int(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1978 GTK_SPIN_BUTTON(widget)));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1979 } else
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
1980 g_return_if_reached();
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
1981 }
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
1982
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
1983 static void
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
1984 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
1985 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
1986 {
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
1987 GtkWidget *widget;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1988 PurpleRequestFieldType field_type;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1989 const gchar *label;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1990
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1991 label = purple_request_field_get_label(setting);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1992
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
1993 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
1994 if (field_type == PURPLE_REQUEST_FIELD_BOOLEAN) {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1995 widget = gtk_check_button_new_with_label(label);
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1996 label = NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1997 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
1998 purple_request_field_bool_get_value(setting));
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
1999 g_signal_connect(G_OBJECT(widget), "toggled",
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2000 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
2001 } 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
2002 widget = gtk_entry_new();
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2003 gtk_entry_set_text(GTK_ENTRY(widget),
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2004 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
2005 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
2006 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
2007 g_signal_connect(G_OBJECT(widget), "changed",
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2008 G_CALLBACK(keyring_page_settings_changed), setting);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2009 } else if (field_type == PURPLE_REQUEST_FIELD_INTEGER) {
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2010 widget = gtk_spin_button_new_with_range(
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2011 purple_request_field_int_get_lower_bound(setting),
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2012 purple_request_field_int_get_upper_bound(setting), 1);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2013 gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget),
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2014 purple_request_field_int_get_value(setting));
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2015 g_signal_connect(G_OBJECT(widget), "value-changed",
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2016 G_CALLBACK(keyring_page_settings_changed), setting);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2017 } else {
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2018 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
2019 return;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2020 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2021
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2022 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
2023 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2024
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2025 /* 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
2026 static void
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2027 keyring_page_add_settings(PidginPrefsWindow *win)
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2028 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2029 GtkWidget *box;
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2030 GList *it, *groups;
34187
daf255359b96 Use GtkSizeGroup for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34186
diff changeset
2031 GtkSizeGroup *sg;
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2032
40490
fb6e46c4c63c Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents: 40480
diff changeset
2033 box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2034 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
2035
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2036 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2037
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2038 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
2039 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
2040 GList *it2, *fields;
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2041 GtkBox *vbox;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2042 PurpleRequestFieldGroup *group;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2043 const gchar *group_title;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2044
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2045 group = it->data;
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2046 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
2047 if (group_title) {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2048 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
2049 } else {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2050 vbox = GTK_BOX(box);
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2051 }
34186
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2052
1d9ea89d4934 Group and string support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34185
diff changeset
2053 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
2054 for (it2 = g_list_first(fields); it2 != NULL;
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2055 it2 = g_list_next(it2)) {
39748
afe5a040286c Simplify setup of keyring option widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39747
diff changeset
2056 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
2057 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2058 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2059
34195
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2060 g_object_unref(sg);
31202151cde1 Initial master password implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34193
diff changeset
2061
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2062 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
2063 }
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2064
5fcfc69be362 Added support for master password in pidgin's pref interface.
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents: 33987
diff changeset
2065 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2066 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
2067 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2068 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2069
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2070 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
2071 return;
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2072 }
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2073
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2074 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
2075 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2076
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2077 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2078 keyring_page_update_settings(PidginPrefsWindow *win)
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2079 {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2080 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
2081 win->keyring.settings = purple_keyring_read_settings();
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2082 if (!win->keyring.settings) {
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2083 return;
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2084 }
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2085
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2086 keyring_page_add_settings(win);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2087
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2088 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
2089 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
2090 win->keyring.apply, FALSE, FALSE, 1);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2091 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
2092 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
2093 G_CALLBACK(keyring_page_settings_apply), win);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2094
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2095 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
2096 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2097
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2098 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2099 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
2100 {
34155
567c48f9658c Refactor the keyring API
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34151
diff changeset
2101 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
2102
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2103 if (prefs == NULL) {
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2104 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
2105 return;
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2106 }
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2107
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2108 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
2109
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2110 if (error != NULL) {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2111 pidgin_prefs_bind_dropdown_revert_active(
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2112 &prefs->keyring.active);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2113 purple_notify_error(NULL, _("Keyring"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2114 _("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
2115 return;
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2116 }
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2117
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2118 g_return_if_fail(in_use != NULL);
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2119 purple_prefs_set_string("/purple/keyring/active",
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2120 purple_keyring_get_id(in_use));
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2121
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2122 keyring_page_update_settings(prefs);
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2123 }
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2124
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2125 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2126 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
2127 {
34122
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2128 const char *keyring_id;
34034
f508fa47f2ac Reformat many things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 34023
diff changeset
2129 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
2130
2eeece506582 Don't let activate disabled keyring, pidgin_prefs_dropdown_revert_active implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34121
diff changeset
2131 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
2132
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2133 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
2134 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
2135 if (keyring == NULL) {
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2136 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
2137 purple_notify_error(NULL, _("Keyring"),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34333
diff changeset
2138 _("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
2139 return;
34120
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2140 }
50bc553c8c52 Handle the case of disabled KWallet system
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34111
diff changeset
2141
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2142 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
2143
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2144 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
2145 g_clear_pointer(&prefs->keyring.settings,
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2146 purple_request_fields_destroy);
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2147
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2148 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
2149 NULL);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2150 }
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2151
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2152 static void
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2153 keyring_page_cleanup(PidginPrefsWindow *win)
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2154 {
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2155 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
2156 }
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2157
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2158 static void
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2159 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
2160 {
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
2161 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
2162
34131
e56d3dd7b0e4 Track migrating passwords in prefs window
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34130
diff changeset
2163 /* 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
2164 names = purple_keyring_get_options();
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2165 win->keyring.active.type = PURPLE_PREF_STRING;
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2166 win->keyring.active.key = "/purple/keyring/active";
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2167 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
2168 /* 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
2169 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
2170 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
2171
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2172 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
2173 }
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
2174
34185
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2175 /*** keyring page - end *************************************************/
cb2fe6b04447 Initial support for keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34181
diff changeset
2176
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2177 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
2178 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
2179 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2180 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
2181 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2182
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2183 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
2184 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
2185 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2186 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
2187 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2188
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2189 static void
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2190 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
2191 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2192 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
2193
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2194 /* Idle stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2195 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
2196 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
2197 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
2198
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2199 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
2200 win->away.mins_before_away);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2201
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2202 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
2203 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
2204
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2205 /* 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
2206 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
2207 gtk_widget_show_all(menu);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2208 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
2209
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2210 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
2211 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
2212 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
2213
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
2214 /* Away stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2215 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
2216 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
2217 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
2218
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2219 /* Signon status stuff */
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2220 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
2221 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
2222
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2223 /* 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
2224 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
2225 gtk_widget_show_all(menu);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2226 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
2227 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
2228 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
2229 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
2230 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
2231 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
2232 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2233
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
2234 #ifdef USE_VV
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2235 static GList *
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2236 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
2237 {
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2238 GList *result = NULL;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2239 GList *i;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2240
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2241 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
2242 type);
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2243 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
2244 PurpleMediaElementInfo *info = i->data;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2245
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2246 result = g_list_append(result,
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2247 purple_media_element_info_get_name(info));
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2248 result = g_list_append(result,
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2249 purple_media_element_info_get_id(info));
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2250 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
2251 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2252
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2253 return result;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2254 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2255
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2256 static GstElement *
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2257 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
2258 {
33947
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2259 PurpleMediaElementInfo *element_info;
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2260
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2261 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
2262
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2263 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
2264
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2265 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
2266 NULL, NULL, NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2267 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2268
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2269 static void
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2270 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
2271 gpointer data)
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2272 {
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2273 PidginPrefsWindow *win = data;
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2274
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2275 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
2276 /* Disable any running test pipelines. */
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2277 gtk_toggle_button_set_active(
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2278 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
2279 gtk_toggle_button_set_active(
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2280 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
2281 }
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2282 }
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
2283
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2284 static GstElement *
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2285 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
2286 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2287 GstElement *pipeline;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2288 GstElement *src, *sink;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2289 GstElement *volume;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2290 GstElement *level;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2291 GstElement *valve;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2292
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2293 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
2294
7c0420c7ac81 VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33934
diff changeset
2295 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
2296 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
2297 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
2298 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
2299 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
2300
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2301 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
2302 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
2303
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2304 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
2305 "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
2306 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
2307 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
2308
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2309 return pipeline;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2310 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2311
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2312 static void
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
2313 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
2314 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2315 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
2316 GstElement *volume;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2317
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2318 if (!win->vv.voice.pipeline) {
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
2319 return;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2320 }
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2321
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2322 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
2323 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
2324 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
2325 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2326
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2327 static gdouble
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2328 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
2329 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2330 const GValue *list;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2331 const GValue *value;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2332 gdouble value_db;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2333 gdouble percent;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2334
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2335 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
2336 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
2337 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
2338 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
2339 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
2340 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
2341 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
2342 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2343
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2344 static gboolean
35567
ea40288b061e Make some VV pref variables global.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35532
diff changeset
2345 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
2346 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2347 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
2348
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2349 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
2350 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
2351
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2352 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
2353 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
2354
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
2355 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
2356 gdouble percent;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2357 gdouble threshold;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2358 GstElement *valve;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2359
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2360 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
2361 gtk_progress_bar_set_fraction(
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2362 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
2363
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2364 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
2365 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
2366 win->vv.voice.threshold)) /
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2367 100.0;
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2368 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
2369 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
2370 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
2371 (percent < threshold) ? _("DROP") : " ",
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2372 NULL);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2373 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2374
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2375 g_free(name);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2376 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2377
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2378 return TRUE;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2379 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2380
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2381 static void
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2382 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
2383 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2384 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
2385
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2386 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
2387 return;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2388 }
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2389
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2390 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
2391 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
2392 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2393
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2394 static void
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2395 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
2396 {
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2397 GstBus *bus;
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2398
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2399 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
2400 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
2401 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
2402 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
2403 gst_object_unref(bus);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2404 }
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2405
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2406 static void
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2407 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
2408 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2409 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2410
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2411 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
2412 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
2413 enable_voice_test(win);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2414
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2415 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
2416 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
2417 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
2418 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
2419 } else {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2420 gtk_progress_bar_set_fraction(
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2421 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
2422 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
2423 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
2424 "any-signal::value-changed",
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2425 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
2426 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
2427 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
2428 NULL);
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2429 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
2430 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2431 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2432
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2433 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
2434 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
2435 {
33622
cd86e355b945 Fix some function arguments, which were the real cause of ce1a071ef316.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33564
diff changeset
2436 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
2437 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2438
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2439 static void
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2440 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
2441 {
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2442 int value;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2443 char *tmp;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2444
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2445 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
2446 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
2447 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
2448 g_free(tmp);
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2449
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2450 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
2451 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2452
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2453 static void
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2454 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
2455 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2456 GObject *test;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2457 GObject *label;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2458 GObject *volume;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2459 GObject *threshold;
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2460 char *tmp;
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2461
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2462 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
2463 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
2464 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
2465 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
2466 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
2467 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
2468
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2469 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
2470 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
2471 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
2472 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
2473 g_free(tmp);
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2474
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2475 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
2476 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
2477 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
2478 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
2479 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
2480 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
2481
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2482 win->vv.voice.level =
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2483 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
2484
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2485 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
2486 g_signal_connect(test, "toggled",
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2487 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
2488 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
2489 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
2490
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2491 static GstElement *
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2492 create_video_pipeline(void)
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2493 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2494 GstElement *pipeline;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2495 GstElement *src, *sink;
37616
7ae670e19fb4 Add videoconvert into test video pipeline
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37615
diff changeset
2496 GstElement *videoconvert;
37653
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
2497 GstElement *videoscale;
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2498
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2499 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
2500 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
2501 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
2502 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
2503 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
2504
33948
b6c9e5dd95d1 VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33947
diff changeset
2505 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
2506
37653
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
2507 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
2508 NULL);
dfadb1bef243 media: add videoscale before video sink
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37616
diff changeset
2509 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
2510
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2511 return pipeline;
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2512 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2513
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2514 static void
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2515 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
2516 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2517 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
2518
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2519 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
2520 return;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2521 }
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2522
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2523 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
2524 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
2525 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2526
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2527 static void
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2528 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
2529 {
39778
46b1141b3662 Drop checks for old GStreamer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
2530 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
2531 !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
2532 return;
39778
46b1141b3662 Drop checks for old GStreamer.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
2533 }
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2534
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2535 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
2536 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
2537 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
2538 (gpointer)window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2539
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2540 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
2541 window_id);
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2542 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2543
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2544 static void
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2545 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
2546 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2547 GstBus *bus;
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2548 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
2549 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
2550
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2551 #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
2552 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
2553 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
2554 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2555 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2556 #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
2557 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
2558 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
2559 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2560 #endif
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2561 #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
2562 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
2563 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
2564 else
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2565 #endif
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2566 g_warning("Unsupported GDK backend");
33520
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2567 #if !(defined(GDK_WINDOWING_WIN32) \
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2568 || defined(GDK_WINDOWING_X11) \
e7741c77c5b2 Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33519
diff changeset
2569 || 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
2570 # 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
2571 #endif
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2572
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2573 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
2574 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
2575 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
2576 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
2577 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
2578 gst_object_unref(bus);
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2579
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2580 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
2581 GST_STATE_PLAYING);
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2582 }
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2583
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2584 static void
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2585 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
2586 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2587 PidginPrefsWindow *win = PIDGIN_PREFS_WINDOW(data);
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2588
35569
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2589 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
2590 enable_video_test(win);
33504
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2591 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
2592 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
2593 } else {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2594 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
2595 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
2596 NULL);
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2597 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
2598 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2599 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2600
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2601 static void
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2602 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
2603 {
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2604 GtkWidget *video;
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2605 GObject *test;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2606 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
2607
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2608 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
2609 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
2610 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
2611 &color);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2612
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2613 /* 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
2614 * 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
2615 * 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
2616 * 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
2617 * 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
2618 *
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2619 * 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
2620 * 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
2621 */
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2622 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
2623 gtk_widget_get_screen(video)));
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2624
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2625 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
2626 g_signal_connect(test, "toggled",
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2627 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
2628 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
2629 }
c4af2548d047 Set up a video test in Preferences.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33503
diff changeset
2630
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
2631 static void
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2632 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
2633 gconstpointer value, gpointer data)
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
2634 {
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2635 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
2636
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2637 PurpleMediaManager *manager;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2638 PurpleMediaElementInfo *info;
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2639
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2640 manager = purple_media_manager_get();
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2641 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
2642 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
2643
5e1cfb0cb4e6 Refresh example VV viewers when user changes options.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35568
diff changeset
2644 /* Refresh test viewers */
39752
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2645 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
2646 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
2647 enable_voice_test(win);
8d8b9860885f Move VV pref globals into dialog struct.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39751
diff changeset
2648 } 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
2649 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
2650 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
2651 }
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
2652 }
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
2653
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2654 static const char *
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2655 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
2656 {
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2657 if (type & PURPLE_MEDIA_ELEMENT_AUDIO) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2658 if (type & PURPLE_MEDIA_ELEMENT_SRC) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2659 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
2660 } 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
2661 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
2662 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2663 } 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
2664 if (type & PURPLE_MEDIA_ELEMENT_SRC) {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2665 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
2666 } 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
2667 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
2668 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2669 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2670
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2671 return NULL;
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2672 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2673
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2674 static void
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2675 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
2676 {
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2677 const gchar *preference_key;
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2678 GList *devices;
35568
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
2679
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2680 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
2681 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
2682
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2683 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
2684 (GCompareFunc)strcmp) == NULL)
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
2685 {
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
2686 GList *next = g_list_next(devices);
1e257009ac10 Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
2687 if (next)
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
2688 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
2689 }
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2690
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2691 combo->type = PURPLE_PREF_STRING;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2692 combo->key = preference_key;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2693 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
2694 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
2695 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2696
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2697 static void
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2698 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
2699 PurpleMediaElementType type)
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2700 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2701 bind_vv_dropdown(combo, type);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2702
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2703 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
2704 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
2705 vv_device_changed_cb, win);
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2706 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
2707 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
2708 combo->combo);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2709
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2710 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
2711 (gpointer)type);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2712 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
2713 }
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2714
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2715 static void
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2716 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
2717 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2718 PidginPrefCombo *combo;
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2719 PurpleMediaElementType media_type;
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2720 GtkTreeModel *model;
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2721
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2722 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
2723 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
2724 "vv_media_type");
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2725
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2726 /* 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
2727 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
2728 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
2729 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
2730 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
2731
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2732 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
2733 }
b66f1935b3d0 Minor re-arrangement for VV prefs code.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 35567
diff changeset
2734
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2735 static GtkWidget *
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2736 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
2737 {
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2738 GtkBuilder *builder;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2739 GtkWidget *ret;
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2740 PurpleMediaManager *manager;
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2741
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2742 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
2743 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
2744
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2745 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
2746
37888
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2747 manager = purple_media_manager_get();
b091d0c4c8dd gtkprefs: update respective combo on "elements-changed"
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37886
diff changeset
2748
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2749 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
2750 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
2751 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
2752 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
2753 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
2754 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2755 win->vv.voice.input.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2756
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2757 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
2758 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
2759 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
2760 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
2761 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
2762 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2763 win->vv.voice.output.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2764
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2765 bind_voice_test(win, builder);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2766
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2767 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
2768 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
2769 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
2770 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
2771 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
2772 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2773 win->vv.video.input.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2774
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2775 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
2776 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
2777 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
2778 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
2779 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
2780 G_CALLBACK(device_list_changed_cb),
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2781 win->vv.video.output.combo, 0);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2782
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2783 bind_video_test(win, builder);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2784
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
2785 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
2786 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
2787
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2788 g_object_ref(ret);
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2789 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
2790
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2791 return ret;
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2792 }
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2793 #endif
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
2794
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
2795 static void
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
2796 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
2797 {
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2798 #ifdef USE_VV
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
2799 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
2800 GtkWidget *vv;
39751
aa2cd6945f70 Remove now-unnecessary page counting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39750
diff changeset
2801 #endif
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2802
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2803 bind_interface_page(win);
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2804 bind_conv_page(win);
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2805 bind_logging_page(win);
39183
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2806 bind_network_page(win);
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2807 bind_proxy_page(win);
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2808 bind_keyring_page(win);
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2809 bind_away_page(win);
39750
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
2810 bind_theme_page(win);
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
2811 #ifdef USE_VV
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2812 vv = vv_page(win);
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
2813 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
2814 "vv", "title", _("Voice/Video"),
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
2815 NULL);
39755
a23faac6d3bb Convert VV prefs page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39754
diff changeset
2816 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
2817 #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
2818 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
2819
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2820 static void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2821 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
2822 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2823 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
2824
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2825 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
2826 widget_class,
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2827 "/im/pidgin/Pidgin/Prefs/prefs.ui"
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2828 );
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2829
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2830 /* Main window */
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
2831 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
2832 stack);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
2833 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
2834
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2835 /* Interface page */
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2836 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2837 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
2838 iface.im.hide_new.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2839 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2840 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
2841 iface.win32.minimize_new_convs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2842 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2843 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
2844 iface.conversations.tabs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2845 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2846 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
2847 iface.conversations.tabs_vbox);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2848 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2849 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
2850 iface.conversations.close_on_tabs);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2851 gtk_widget_class_bind_template_child(
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2852 widget_class, PidginPrefsWindow,
39240
c03b43e0321c gtkprefs: Rename "interface" struct member to "iface"
Mike Ruprecht <cmaiku@gmail.com>
parents: 39189
diff changeset
2853 iface.conversations.tab_side.combo);
39188
093a6314d473 prefs: Convert Interface page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39187
diff changeset
2854
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2855 /* Conversations page */
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2856 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2857 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2858 conversations.notification_chat.combo);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2859 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2860 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2861 conversations.show_incoming_formatting);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2862 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2863 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2864 conversations.im.close_immediately);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2865 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2866 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2867 conversations.im.show_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2868 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2869 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2870 conversations.im.animate_buddy_icons);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2871 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2872 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2873 conversations.im.send_typing);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2874 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2875 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2876 conversations.use_smooth_scrolling);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2877 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2878 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2879 conversations.win32.blink_im);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2880 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2881 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2882 conversations.resize_custom_smileys);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2883 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2884 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2885 conversations.custom_smileys_size);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2886 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2887 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2888 conversations.minimum_entry_lines);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2889 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2890 widget_class, PidginPrefsWindow,
39265
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
2891 conversations.format_buffer);
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
2892 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
2893 widget_class, PidginPrefsWindow,
a34496025e3d Finish up the prefs, at least for format toggles
Gary Kramlich <grim@reaperworld.com>
parents: 39264
diff changeset
2894 conversations.format_view);
39186
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2895 #ifdef WIN32
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2896 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2897 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2898 conversations.font_frame);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2899 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2900 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2901 conversations.use_theme_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2902 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2903 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2904 conversations.custom_font_hbox);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2905 gtk_widget_class_bind_template_child(
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2906 widget_class, PidginPrefsWindow,
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2907 conversations.custom_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2908 #endif
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2909 /* 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
2910 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
2911 apply_custom_font);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2912 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
2913 pidgin_custom_font_set);
5f745be136ad prefs: Convert Conversations page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39185
diff changeset
2914
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2915 /* Logging page */
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2916 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2917 widget_class, PidginPrefsWindow, logging.format.combo);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2918 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2919 widget_class, PidginPrefsWindow, logging.log_ims);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2920 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2921 widget_class, PidginPrefsWindow, logging.log_chats);
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2922 gtk_widget_class_bind_template_child(
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
2923 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
2924
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2925 /* Network page */
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2926 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2927 widget_class, PidginPrefsWindow, network.stun_server);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2928 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2929 widget_class, PidginPrefsWindow, network.auto_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2930 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2931 widget_class, PidginPrefsWindow, network.public_ip);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2932 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2933 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2934 network.public_ip_hbox);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2935 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2936 widget_class, PidginPrefsWindow, network.map_ports);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2937 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2938 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2939 network.ports_range_use);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2940 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2941 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2942 network.ports_range_hbox);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2943 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2944 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2945 network.ports_range_start);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2946 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2947 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2948 network.ports_range_end);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2949 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2950 widget_class, PidginPrefsWindow, network.turn_server);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2951 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2952 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2953 network.turn_port_udp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2954 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2955 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2956 network.turn_port_tcp);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2957 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2958 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2959 network.turn_username);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2960 gtk_widget_class_bind_template_child(
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2961 widget_class, PidginPrefsWindow,
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2962 network.turn_password);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2963 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
2964 network_stun_server_changed_cb);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2965 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
2966 auto_ip_button_clicked_cb);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2967 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
2968 network_ip_changed);
94e46ed81701 prefs: Convert Network page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39182
diff changeset
2969 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
2970 network_turn_server_changed_cb);
39185
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2971
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2972 /* Proxy page */
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2973 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2974 widget_class, PidginPrefsWindow, proxy.stack);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2975 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2976 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
2977 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2978 widget_class, PidginPrefsWindow, proxy.gnome_program);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2979 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2980 widget_class, PidginPrefsWindow,
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2981 proxy.socks4_remotedns);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2982 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2983 widget_class, PidginPrefsWindow, proxy.type.combo);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2984 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2985 widget_class, PidginPrefsWindow, proxy.options);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2986 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2987 widget_class, PidginPrefsWindow, proxy.host);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2988 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2989 widget_class, PidginPrefsWindow, proxy.port);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2990 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2991 widget_class, PidginPrefsWindow, proxy.username);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2992 gtk_widget_class_bind_template_child(
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2993 widget_class, PidginPrefsWindow, proxy.password);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2994 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
2995 proxy_button_clicked_cb);
0a28307fc473 prefs: Convert Proxy page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39184
diff changeset
2996 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
2997 proxy_print_option);
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
2998
39749
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
2999 /* Keyrings page */
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3000 gtk_widget_class_bind_template_child(
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3001 widget_class, PidginPrefsWindow, keyring.active.combo);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3002 gtk_widget_class_bind_template_child(
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3003 widget_class, PidginPrefsWindow, keyring.vbox);
e2dd6507d83e Convert Keyrings page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39748
diff changeset
3004
39189
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3005 /* Away page */
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3006 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
3007 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3008 away.idle_reporting.combo);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3009 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
3010 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3011 away.mins_before_away);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3012 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
3013 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
3014 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
3015 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
3016 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
3017 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3018 away.auto_reply.combo);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3019 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
3020 widget_class, PidginPrefsWindow,
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3021 away.startup_current_status);
d2ca6e91fff8 prefs: Convert Status/Idle page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39188
diff changeset
3022 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
3023 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
3024 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
3025 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
3026
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3027 /* Themes page */
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3028 gtk_widget_class_bind_template_child(
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3029 widget_class, PidginPrefsWindow, theme.blist);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3030 gtk_widget_class_bind_template_child(
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3031 widget_class, PidginPrefsWindow, theme.status);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3032 gtk_widget_class_bind_template_child(
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3033 widget_class, PidginPrefsWindow, theme.smiley);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3034 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
3035 prefs_set_blist_theme_cb);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3036 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
3037 prefs_set_status_icon_theme_cb);
1ead9afaa71e Convert Themes pref page to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39749
diff changeset
3038 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
3039 prefs_set_smiley_theme_cb);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3040 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3041
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3042 static void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3043 pidgin_prefs_window_init(PidginPrefsWindow *win)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3044 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3045 /* 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
3046 * 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
3047 /* (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
3048
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3049 /* 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
3050
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3051 /* Create the window */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3052 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
3053
39779
a01d813df763 Convert prefs to a GtkStack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39755
diff changeset
3054 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
3055
27445
b8bbf88abd0f Allow drag-and-drop of all sorts of themes.
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 27196
diff changeset
3056 /* 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
3057 prefs_themes_refresh();
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3058 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3059
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3060 void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3061 pidgin_prefs_show(void)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3062 {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3063 if (prefs == NULL) {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3064 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
3065 pidgin_prefs_window_get_type(), NULL));
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3066 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3067
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
3068 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
3069 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3070
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3071 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
3072 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
3073 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
3074 {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3075 const gchar *theme_name = value;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3076 GList *themes, *it;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3077
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
3078 if (purple_strequal(theme_name, "none")) {
35708
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3079 purple_smiley_theme_set_current(NULL);
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3080 return;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3081 }
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3082
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3083 /* XXX: could be cached when initializing prefs view */
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3084 themes = pidgin_smiley_theme_get_all();
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3085
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3086 for (it = themes; it; it = g_list_next(it)) {
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3087 PidginSmileyTheme *theme = it->data;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3088
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37989 38265
diff changeset
3089 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
3090 continue;
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3091
8903e6402d5b PidginSmileyTheme: working implementation for gtkprefs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35647
diff changeset
3092 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
3093 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3094 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3095
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3096 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
3097 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
3098 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3099 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
3100 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
3101
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3102 /* 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
3103 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
3104 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
3105
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3106 /* 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
3107 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
3108 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
3109 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
3110 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
3111
23648
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
3112 /* Themes */
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
3113 prefs_themes_init();
a71b9a2345ea fixed images to appear in pref menu
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 23645
diff changeset
3114
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3115 /* 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
3116 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
3117 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
3118
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3119 /* 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
3120 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
3121 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
3122
33634
dff087863072 Fix macro tests for USE_VV.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33622
diff changeset
3123 #ifdef USE_VV
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3124 /* Voice/Video */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3125 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
3126 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
3127 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
3128 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
3129 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
3130 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
3131 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
3132 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
3133 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
3134 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
3135 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
3136 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
3137 #endif
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3138
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3139 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
3140 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3141
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
3142 void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
3143 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
3144 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3145 /* 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
3146 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
3147 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
3148
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3149 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
3150
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3151 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
3152 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
3153
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3154 /* 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
3155 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
3156 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
3157 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
3158 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
3159 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
3160 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
3161 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
3162 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/x");
b31b810fe6db gtkblist: Remove blist position storage
Mike Ruprecht <cmaiku@gmail.com>
parents: 39281
diff changeset
3163 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/y");
40501
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
3164 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
3165 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/browser");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
3166 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/command");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
3167 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/place");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
3168 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/manual_command");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3169 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
3170 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
3171 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
3172 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
3173 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
3174 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
3175 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
3176 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
3177 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
3178 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
3179 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
3180 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
3181 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
3182 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
3183 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
3184 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
3185 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
3186 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
3187 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
3188 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
3189 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
3190 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
3191 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
3192 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
3193 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
3194 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
3195 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon");
40509
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3196 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/command");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3197 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/conv_focus");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3198 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/chat_msg_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3199 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/first_im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3200 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/got_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3201 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3202 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/join_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3203 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/left_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3204 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/login");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3205 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/logout");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3206 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/nick_said");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3207 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/pounce_default");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3208 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/send_chat_msg");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3209 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/send_im");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3210 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/sent_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3211 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3212 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/chat_msg_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3213 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/first_im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3214 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/got_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3215 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3216 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/join_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3217 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/left_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3218 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/login");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3219 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/logout");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3220 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/nick_said");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3221 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/pounce_default");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3222 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/send_chat_msg");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3223 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/send_im");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3224 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/sent_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3225 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3226 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/method");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3227 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/mute");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3228 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/theme");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
3229 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3230
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3231 /* 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
3232 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
3233 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
3234 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3235 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
3236 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3237 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
3238 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
3239 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3240 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
3241 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3242 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
3243 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
3244 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
3245
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3246 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
3247 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
3248 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
3249 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
3250 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
3251 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
3252 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
3253 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
3254
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3255 /* Fixup vvconfig plugin prefs */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3256 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
3257 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
3258 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
3259 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3260 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
3261 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
3262 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
3263 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3264 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
3265 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
3266 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
3267 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3268 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
3269 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
3270 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
3271 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3272
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3273 purple_prefs_remove("/plugins/core/vvconfig");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3274 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
3275
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
3276 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
3277 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
3278 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
3279 purple_prefs_remove(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/plugin");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
3280 }
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
3281

mercurial