pidgin/prefs/pidginprefs.c

Tue, 23 Aug 2022 04:28:29 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Tue, 23 Aug 2022 04:28:29 -0500
branch
gtk4
changeset 41581
732b1fcb8e31
parent 41553
ec1986cf9a1e
child 41620
c6f7795ae294
permissions
-rw-r--r--

Fix prefs on GTK4

Testing Done:
Opened prefs, saw no warnings, toggled a few buttons, switched proxy modes, tried out audio & video test. Video test crashes as we probably need to port to a different sink.

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

41397
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
1 /*
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
2 * Pidgin - Internet Messenger
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.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
4 *
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 * 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
6 * 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
7 * 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
8 *
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 * 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
10 * 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
11 * 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
12 * (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
13 *
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 * 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
15 * 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
16 * 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
17 * 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
18 *
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 * You should have received a copy of the GNU General Public License
41397
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
21 */
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
22
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
23 #ifdef HAVE_CONFIG_H
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
24 # include <config.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
25 #endif
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
26
40462
24ed25d87550 Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
27 #include <errno.h>
24ed25d87550 Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
28 #include <math.h>
24ed25d87550 Fix some issues on macos that resulted from the internal.h cleanup
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
29
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
30 #include <glib/gi18n-lib.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40350
diff changeset
31 #include <glib/gstdio.h>
39264
8a7a775de597 Initial work moving gtkprefs to talkatu
Gary Kramlich <grim@reaperworld.com>
parents: 39189
diff changeset
32
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
33 #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
34
41397
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
35 #include "pidginprefs.h"
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
36 #include "pidginprefsinternal.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"
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40490
diff changeset
38 #include "pidgincore.h"
41394
1327e58acce3 Split VV prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41390
diff changeset
39 #include "pidginvvprefs.h"
34225
3bba206f27f6 HTTP: migrate purple_util_fetch_url to new API for Pidgin UI
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34208
diff changeset
40
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
41 struct _PidginPrefsWindow {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
42 GtkDialog parent;
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
43 };
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
44
29149
773c9d17e637 Re-order variables to follow widget hierarchy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29148
diff changeset
45 /* Main dialog */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
46 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
47
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
48 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
49
41397
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
50 /******************************************************************************
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
51 * Helpers
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
52 *****************************************************************************/
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
53 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
54 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
55 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
56 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
57 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
58
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
59 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
60
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
61 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
62 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
63
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
64 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
65 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
66 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
67 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
68 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
69 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
70 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
71
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
72 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
73
33172
9fb9057fc55c Fix warnings about GtkAdjustments on GTK+2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33170
diff changeset
74 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
75 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
76 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
77 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
78 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
79 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
80 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
81 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
82 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
83
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
84 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
85 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
86
41366
789f96848a43 Expose prefs binding functions internally
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41319
diff changeset
87 void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
88 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
89 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
90 GtkAdjustment *adjust;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
91 int val;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
92
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
93 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
94
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
95 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
96 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
97 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
98 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
99 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
100 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
101
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
102 static void
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
103 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
104 {
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
105 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
106
41531
2b86501d13fe Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents: 41490
diff changeset
107 purple_prefs_set_string(key, gtk_editable_get_text(GTK_EDITABLE(entry)));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
108 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
109
41366
789f96848a43 Expose prefs binding functions internally
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41319
diff changeset
110 void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
111 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
112 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
113 const gchar *value;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
114
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
115 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
116
41531
2b86501d13fe Replace gtk_entry_[gs]et_text with gtk_editable_[gs]et_text
Gary Kramlich <grim@reaperworld.com>
parents: 41490
diff changeset
117 gtk_editable_set_text(GTK_EDITABLE(entry), value);
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
118 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
119 (char*)key);
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
120 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
121
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
122 static void
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
123 dropdown_set(GtkComboBox *combo_box, G_GNUC_UNUSED gpointer data)
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
124 {
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
125 GtkTreeIter iter;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
126 GtkTreeModel *tree_model;
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
127 PurplePrefType type;
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
128 const char *key;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
129
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
130 tree_model = gtk_combo_box_get_model(combo_box);
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
131 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
132 return;
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
133 }
34130
ddd296858810 Simplify reverting dropdown changes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34122
diff changeset
134
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
135 type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(combo_box), "type"));
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
136 key = g_object_get_data(G_OBJECT(combo_box), "key");
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
137 if (type == PURPLE_PREF_INT) {
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
138 gint value;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
139 gtk_tree_model_get(tree_model, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
140 purple_prefs_set_int(key, value);
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
141 } else if (type == PURPLE_PREF_STRING) {
41388
4df8fa04b777 Fix leak in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41387
diff changeset
142 gchar *value;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
143 gtk_tree_model_get(tree_model, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
144 purple_prefs_set_string(key, value);
41388
4df8fa04b777 Fix leak in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41387
diff changeset
145 g_free(value);
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
146 } else if (type == PURPLE_PREF_BOOLEAN) {
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
147 gboolean value;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
148 gtk_tree_model_get(tree_model, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
149 purple_prefs_set_bool(key, value);
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
150 } else {
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
151 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
152 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
153 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
154
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
155 GtkWidget *
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
156 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title,
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
157 PurplePrefType type, const char *key, GList *menuitems)
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
158 {
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
159 GtkWidget *dropdown = NULL;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
160 GtkWidget *label = NULL;
32904
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
161 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
162 GtkTreeIter active;
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
163 GtkCellRenderer *renderer;
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
164 gint pref_int_value = 0;
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
165 const gchar *pref_str_value = NULL;
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
166 gboolean pref_bool_value = FALSE;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
167
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
168 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
169
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
170 if (type == PURPLE_PREF_INT) {
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
171 pref_int_value = purple_prefs_get_int(key);
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
172 store = gtk_list_store_new(PIDGIN_PREF_COMBO_N_COLUMNS, G_TYPE_STRING,
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
173 G_TYPE_INT);
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
174 } else if (type == PURPLE_PREF_STRING) {
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
175 pref_str_value = purple_prefs_get_string(key);
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
176 store = gtk_list_store_new(PIDGIN_PREF_COMBO_N_COLUMNS, G_TYPE_STRING,
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
177 G_TYPE_STRING);
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
178 } else if (type == PURPLE_PREF_BOOLEAN) {
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
179 pref_bool_value = purple_prefs_get_bool(key);
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
180 store = gtk_list_store_new(PIDGIN_PREF_COMBO_N_COLUMNS, G_TYPE_STRING,
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
181 G_TYPE_BOOLEAN);
32904
f62f39d03dc7 Silence a warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32900
diff changeset
182 } else {
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
183 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
184 }
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
185
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
186 dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
187 g_object_set_data(G_OBJECT(dropdown), "type", GINT_TO_POINTER(type));
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
188
40326
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
189 for (; menuitems != NULL; menuitems = g_list_next(menuitems)) {
40329
b5e0f65a5d9c Replace PurpleNamedValue with PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents: 40326
diff changeset
190 const PurpleKeyValuePair *menu_item = menuitems->data;
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
191 GtkTreeIter iter;
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
192
40329
b5e0f65a5d9c Replace PurpleNamedValue with PurpleKeyValuePair
qarkai <qarkai@gmail.com>
parents: 40326
diff changeset
193 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
194 break;
cdca03a74387 Add PurpleNamedValue to use in lists instead of consecutive key and value elements
qarkai <qarkai@gmail.com>
parents: 40195
diff changeset
195 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
196
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
197 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
198 gtk_list_store_set(store, &iter,
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
199 PIDGIN_PREF_COMBO_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
200 -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
201
41384
4c6807a2260d Inline pidgin_prefs_dropdown_from_list_with_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41383
diff changeset
202 if (type == PURPLE_PREF_INT) {
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
203 gint value = GPOINTER_TO_INT(menu_item->value);
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
204 gtk_list_store_set(store, &iter, PIDGIN_PREF_COMBO_VALUE, value, -1);
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
205 if (pref_int_value == value) {
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
206 active = iter;
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
207 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
208
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
209 } else if (type == PURPLE_PREF_STRING) {
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
210 const gchar *value = (const gchar *)menu_item->value;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
211 gtk_list_store_set(store, &iter, PIDGIN_PREF_COMBO_VALUE, value, -1);
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
212 if (purple_strequal(pref_str_value, value)) {
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
213 active = iter;
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
214 }
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
215
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
216 } else if (type == PURPLE_PREF_BOOLEAN) {
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
217 gboolean value = (gboolean)GPOINTER_TO_INT(menu_item->value);
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
218 gtk_list_store_set(store, &iter, PIDGIN_PREF_COMBO_VALUE, value, -1);
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
219 if (pref_bool_value == value) {
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
220 active = iter;
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
221 }
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
222 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
223 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
224
26934
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
225 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
226 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
227 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
228 "text", 0,
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
229 NULL);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
230
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
231 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dropdown), &active);
988bd68379f8 Replace GtkOptionMenu with a GtkComboBox in the preferences dropdowns for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26628
diff changeset
232
41380
e3934b4c2950 Inline pidgin_prefs_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41371
diff changeset
233 g_signal_connect(dropdown, "changed", G_CALLBACK(dropdown_set), 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
234
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
235 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
236
34121
797caf9ff740 pidgin_prefs_dropdown_from_list_with_cb implementation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34120
diff changeset
237 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
238
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
239 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
240 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
241
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
242 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
243 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
244 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
245 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
246 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
247 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
248 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
249 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
250
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
251 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
252 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
253
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
254 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
255 while ((name = va_arg(ap, char *)) != NULL) {
40781
65dbbd384c8e Fix pidgin_prefs_dropdown
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40765
diff changeset
256 PurpleKeyValuePair *kvp;
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
257
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
258 if (type == PURPLE_PREF_INT || type == PURPLE_PREF_BOOLEAN) {
40781
65dbbd384c8e Fix pidgin_prefs_dropdown
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40765
diff changeset
259 kvp = purple_key_value_pair_new(name, GINT_TO_POINTER(va_arg(ap, int)));
65dbbd384c8e Fix pidgin_prefs_dropdown
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40765
diff changeset
260 } else {
65dbbd384c8e Fix pidgin_prefs_dropdown
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40765
diff changeset
261 kvp = purple_key_value_pair_new(name, va_arg(ap, char *));
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
262 }
40781
65dbbd384c8e Fix pidgin_prefs_dropdown
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40765
diff changeset
263 menuitems = g_list_prepend(menuitems, kvp);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
264 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
265 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
266
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
267 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
268
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
269 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
270
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
271 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
272 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
273
40781
65dbbd384c8e Fix pidgin_prefs_dropdown
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40765
diff changeset
274 g_list_free_full(menuitems, (GDestroyNotify)purple_key_value_pair_free);
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
275
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
276 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
277 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
278
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
279 static void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
280 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
281 {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
282 PidginPrefCombo *combo = data;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
283 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
284 GtkTreeModel *tree_model;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
285
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
286 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
287 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
288 return;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
289
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
290 if (combo->type == PURPLE_PREF_INT) {
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
291 gint value;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
292 gtk_tree_model_get(tree_model, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
293 purple_prefs_set_int(combo->key, value);
41381
acedeb1e8804 Inline pidgin_prefs_bind_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41380
diff changeset
294 } else if (combo->type == PURPLE_PREF_STRING) {
41388
4df8fa04b777 Fix leak in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41387
diff changeset
295 gchar *value;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
296 gtk_tree_model_get(tree_model, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
297 purple_prefs_set_string(combo->key, value);
41388
4df8fa04b777 Fix leak in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41387
diff changeset
298 g_free(value);
41381
acedeb1e8804 Inline pidgin_prefs_bind_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41380
diff changeset
299 } else if (combo->type == PURPLE_PREF_BOOLEAN) {
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
300 gboolean value;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
301 gtk_tree_model_get(tree_model, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
302 purple_prefs_set_bool(combo->key, value);
41381
acedeb1e8804 Inline pidgin_prefs_bind_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41380
diff changeset
303 } else {
acedeb1e8804 Inline pidgin_prefs_bind_dropdown_from_list_cb
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41380
diff changeset
304 g_return_if_reached();
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
305 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
306 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
307
41366
789f96848a43 Expose prefs binding functions internally
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41319
diff changeset
308 void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
309 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
310 {
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
311 GtkTreeModel *store = NULL;
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
312 GtkTreeIter iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
313 GtkTreeIter active;
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
314 int pref_int_value = 0;
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
315 const char *pref_str_value = NULL;
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
316 gboolean pref_bool_value = FALSE;
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
317
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
318 if (combo->type == PURPLE_PREF_INT) {
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
319 pref_int_value = purple_prefs_get_int(combo->key);
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
320 } else if (combo->type == PURPLE_PREF_STRING) {
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
321 pref_str_value = purple_prefs_get_string(combo->key);
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
322 } else if (combo->type == PURPLE_PREF_BOOLEAN) {
41383
686ea9361312 Drop pref value tracking on PidginPrefsCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41382
diff changeset
323 pref_bool_value = purple_prefs_get_bool(combo->key);
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
324 } else {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
325 g_return_if_reached();
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
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
328 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
329
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
330 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
331 g_return_if_reached();
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
332 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
333
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
334 do {
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
335 if (combo->type == PURPLE_PREF_INT) {
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
336 gint value = 0;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
337 gtk_tree_model_get(store, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
338 if (pref_int_value == value) {
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
339 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
340 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
341 }
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
342
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
343 } else if (combo->type == PURPLE_PREF_STRING) {
41388
4df8fa04b777 Fix leak in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41387
diff changeset
344 gchar *value = NULL;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
345 gtk_tree_model_get(store, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
346 if (purple_strequal(pref_str_value, value)) {
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
347 active = iter;
41388
4df8fa04b777 Fix leak in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41387
diff changeset
348 g_free(value);
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
349 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
350 }
41388
4df8fa04b777 Fix leak in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41387
diff changeset
351 g_free(value);
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
352
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
353 } else if (combo->type == PURPLE_PREF_BOOLEAN) {
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
354 gboolean value = FALSE;
41390
628971e4ecdf Expose PidginPrefCombo model enum in internal API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41388
diff changeset
355 gtk_tree_model_get(store, &iter, PIDGIN_PREF_COMBO_VALUE, &value, -1);
41387
146db40a9f24 Simplify active iter processing in PidginPrefCombo
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41386
diff changeset
356 if (pref_bool_value == value) {
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
357 active = iter;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
358 break;
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
359 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
360 }
39754
0149cda729f7 Simplify some type casts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39752
diff changeset
361 } 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
362
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
363 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
364
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
365 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
366 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
367 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
368
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
369 static void
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
370 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
371 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
372 purple_prefs_set_bool(key,
41581
732b1fcb8e31 Fix prefs on GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41553
diff changeset
373 gtk_check_button_get_active(GTK_CHECK_BUTTON(w)));
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
374 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
375
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
376 GtkWidget *
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
377 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
378 {
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
379 GtkWidget *button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
380
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
381 button = gtk_check_button_new_with_mnemonic(text);
41581
732b1fcb8e31 Fix prefs on GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41553
diff changeset
382 gtk_check_button_set_active(GTK_CHECK_BUTTON(button),
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
383 purple_prefs_get_bool(key));
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
384
41553
ec1986cf9a1e Convert main prefs to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41531
diff changeset
385 gtk_box_append(GTK_BOX(page), button);
39180
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
386
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
387 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
388 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
389
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
390 return button;
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
391 }
17bacc12c28f prefs: Move pidgin_prefs_checkbox earlier.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39179
diff changeset
392
41366
789f96848a43 Expose prefs binding functions internally
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41319
diff changeset
393 void
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
394 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
395 {
41581
732b1fcb8e31 Fix prefs on GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41553
diff changeset
396 gtk_check_button_set_active(GTK_CHECK_BUTTON(button),
39181
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
397 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
398 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
399 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
400 }
f0cd633d86d4 prefs: Add binding versions of pref widget functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39180
diff changeset
401
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
402 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
403 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
404 {
40509
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
405 /* Close any request dialogs */
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
406 purple_request_close_with_handle(prefs);
34188
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
407 purple_notify_close_with_handle(prefs);
0680f2c10db3 Validation for internal keyring settings
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34187
diff changeset
408
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
409 /* 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
410 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
411
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
412 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
413 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
414
41385
d2f5ce624a49 Use GtkListStore for populating VV device prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41384
diff changeset
415 static void
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
416 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
417 gpointer data)
33505
76208141a643 Disable VV tests when changing notebook tabs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33504
diff changeset
418 {
41394
1327e58acce3 Split VV prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41390
diff changeset
419 PidginVVPrefs *vv_prefs = data;
39780
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
420
90027b926a3e Simplify signals for disabling VV pref tests.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39779
diff changeset
421 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
422 /* Disable any running test pipelines. */
41394
1327e58acce3 Split VV prefs into a separate widget
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41390
diff changeset
423 pidgin_vv_prefs_disable_test_pipelines(vv_prefs);
33503
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
424 }
8959f9825768 Copy audio test from vvconfig into Preferences window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33502
diff changeset
425 }
33502
f59489bd552b Copy VV device settings into a Preferences pane.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33357
diff changeset
426
41397
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
427 /******************************************************************************
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
428 * GObject Implementation
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
429 *****************************************************************************/
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
430 static void
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
431 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
432 {
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
433 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
434
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
435 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
436 widget_class,
41030
ec8b76f3bf0a Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents: 40886
diff changeset
437 "/im/pidgin/Pidgin3/Prefs/prefs.ui"
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
438 );
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
439
39182
a7a028be4bcd prefs: Convert Logging page to glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39181
diff changeset
440 /* Main window */
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
441 gtk_widget_class_bind_template_callback(widget_class, delete_prefs);
41490
2b1695327414 Make VV libraries required
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41397
diff changeset
442 gtk_widget_class_bind_template_callback(widget_class,
2b1695327414 Make VV libraries required
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41397
diff changeset
443 vv_test_switch_page_cb);
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
444 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
445
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
446 static void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
447 pidgin_prefs_window_init(PidginPrefsWindow *win)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
448 {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
449 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
450 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
451
41397
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
452 /******************************************************************************
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
453 * API
91e5ee47f5a1 Cleanup pidgin prefs
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41394
diff changeset
454 *****************************************************************************/
39178
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
455 void
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
456 pidgin_prefs_show(void)
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
457 {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
458 if (prefs == NULL) {
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
459 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
460 pidgin_prefs_window_get_type(), NULL));
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
461 }
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
462
53a96425ffc0 Start switching Preferences dialog to Glade.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39177
diff changeset
463 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
464 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
465
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
466 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
467 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
468 {
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
469 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
470 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
471
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
472 /* 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
473 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
474 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
475
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 /* 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
477 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
478 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
479 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
480 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
481
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
482 /* Voice/Video */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
483 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
484 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
485 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
486 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
487 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
488 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
489 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
490 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
491 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
492 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
493 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
494 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
495
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
496 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
497 }
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
498
27493
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
499 void
96dc1b8abdf9 You should check the indenting before a copy & paste...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27451
diff changeset
500 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
501 {
40547
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
502 const gchar *video_sink = NULL;
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
503
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
504 /* 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
505 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
506
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 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
508 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
509
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
510 /* 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
511 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
512 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
513 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
514 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
515 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
516 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
517 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
518 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/x");
b31b810fe6db gtkblist: Remove blist position storage
Mike Ruprecht <cmaiku@gmail.com>
parents: 39281
diff changeset
519 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/y");
40501
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
520 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
521 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/browser");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
522 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/command");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
523 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/place");
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
524 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/manual_command");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
525 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
526 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
527 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
528 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
529 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
530 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
531 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
532 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
533 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
534 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
535 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
536 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
537 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
538 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
539 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
540 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
541 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
542 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
543 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
544 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
545 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
546 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
547 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
548 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon");
40509
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
549 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/command");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
550 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/conv_focus");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
551 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/chat_msg_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
552 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/first_im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
553 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/got_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
554 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
555 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/join_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
556 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/left_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
557 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/login");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
558 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/logout");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
559 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/nick_said");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
560 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/pounce_default");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
561 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/send_chat_msg");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
562 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/send_im");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
563 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled/sent_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
564 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/enabled");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
565 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/chat_msg_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
566 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/first_im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
567 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/got_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
568 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/im_recv");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
569 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/join_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
570 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/left_chat");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
571 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/login");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
572 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/logout");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
573 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/nick_said");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
574 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/pounce_default");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
575 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/send_chat_msg");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
576 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/send_im");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
577 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file/sent_attention");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
578 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/file");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
579 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/method");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
580 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/mute");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
581 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/theme");
6748a5ec6644 remove the old sound api
Gary Kramlich <grim@reaperworld.com>
parents: 40504
diff changeset
582 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
583
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
584 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
585 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
586 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
587
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
588 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
589 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
590 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
591 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
592 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
593 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
594 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
595 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
596
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
597 /* Fixup vvconfig plugin prefs */
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
598 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
599 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
600 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
601 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
602 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
603 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
604 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
605 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
606 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
607 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
608 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
609 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
610 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
611 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
612 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
613 }
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
614
40547
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
615 video_sink = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device");
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
616 if (purple_strequal(video_sink, "glimagesink") || purple_strequal(video_sink, "directdrawsink")) {
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
617 /* Accelerated sinks move to GTK GL. */
40647
33d7e6abb37f Fix a few random issues that scanbuild found.
Gary Kramlich <grim@reaperworld.com>
parents: 40552
diff changeset
618 /* video_sink = "gtkglsink"; */
40547
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
619 /* FIXME: I haven't been able to get gtkglsink to work yet: */
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
620 video_sink = "gtksink";
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
621 } else {
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
622 /* Everything else, including default will be moved to GTK sink. */
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
623 video_sink = "gtksink";
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
624 }
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
625 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device", video_sink);
86e0c5080a58 vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40542
diff changeset
626
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
627 purple_prefs_remove("/plugins/core/vvconfig");
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
628 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
629
37886
d4ed67195cbf gtkprefs: rework Voice/Video preferences page
Jakub Adam <jakub.adam@ktknet.cz>
parents: 37677
diff changeset
630 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
631 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
632 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
633 purple_prefs_remove(PIDGIN_PREFS_ROOT "/vvconfig/video/sink/plugin");
22419
e7d643f4de4b Bring back the "Close IMs immediately when the tab is closed" pref. As far
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22412
diff changeset
634 }
33508
188563e24535 Migrate and correctly create VV prefs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33507
diff changeset
635

mercurial