pidgin/gtkprefs.c

Tue, 31 Mar 2020 01:49:27 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 31 Mar 2020 01:49:27 -0500
changeset 40371
0773c993abd8
parent 40350
72271baf92bc
child 40439
e9838d634d5e
permissions
-rw-r--r--

Migrate add-chat and add-buddy to the new menu

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

mercurial